templates
Creates, updates, deletes, gets or lists a templates resource.
Overview
| Name | templates |
| Type | Resource |
| Id | aws.pca_connector_ad.templates |
Fields
The following fields are returned by SELECT queries:
- list_templates
- get_template
| Name | Datatype | Description |
|---|---|---|
arn | string | The Amazon Resource Name (ARN) that was returned when you called CreateTemplate. (pattern: <code>^arn:[\w-]+:pca-connector-ad:[\w-]+:[0-9]+:connector/[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/template/[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$</code>) |
connector_arn | string | The Amazon Resource Name (ARN) that was returned when you called CreateConnector. (pattern: <code>^arn:[\w-]+:pca-connector-ad:[\w-]+:[0-9]+:connector/[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$</code>) |
created_at | string (date-time) | The date and time that the template was created. |
definition | object | Template configuration to define the information included in certificates. Define certificate validity and renewal periods, certificate request handling and enrollment options, key usage extensions, application policies, and cryptography settings. |
name | string | Name of the template. The template name must be unique. (pattern: <code>^(?!^\s+$)((?![\x5c'\x2b,;<=>#\x22])([\x20-\x7E]))+$</code>) |
object_identifier | string | Object identifier of a template. (pattern: <code>^([0-2]).([0-9]|([0-3][0-9]))(.([0-9]+)){0,126}$</code>) |
policy_schema | integer | The template schema version. Template schema versions can be v2, v3, or v4. The template configuration options change based on the template schema version. |
revision | object | The revision version of the template. Template updates will increment the minor revision. Re-enrolling all certificate holders will increment the major revision. |
status | string | Status of the template. Status can be creating, active, deleting, or failed. (ACTIVE, DELETING) |
updated_at | string (date-time) | The date and time that the template was updated. |
| Name | Datatype | Description |
|---|---|---|
arn | string | The Amazon Resource Name (ARN) that was returned when you called CreateTemplate. (pattern: <code>^arn:[\w-]+:pca-connector-ad:[\w-]+:[0-9]+:connector/[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/template/[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$</code>) |
connector_arn | string | The Amazon Resource Name (ARN) that was returned when you called CreateConnector. (pattern: <code>^arn:[\w-]+:pca-connector-ad:[\w-]+:[0-9]+:connector/[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$</code>) |
created_at | string (date-time) | The date and time that the template was created. |
definition | object | Template configuration to define the information included in certificates. Define certificate validity and renewal periods, certificate request handling and enrollment options, key usage extensions, application policies, and cryptography settings. |
name | string | Name of the templates. Template names must be unique. (pattern: <code>^(?!^\s+$)((?![\x5c'\x2b,;<=>#\x22])([\x20-\x7E]))+$</code>) |
object_identifier | string | Object identifier of a template. (pattern: <code>^([0-2]).([0-9]|([0-3][0-9]))(.([0-9]+)){0,126}$</code>) |
policy_schema | integer | The template schema version. Template schema versions can be v2, v3, or v4. The template configuration options change based on the template schema version. |
revision | object | The version of the template. Template updates will increment the minor revision. Re-enrolling all certificate holders will increment the major revision. |
status | string | Status of the template. Status can be creating, active, deleting, or failed. (ACTIVE, DELETING) |
updated_at | string (date-time) | The date and time that the template was updated. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_templates | select | ConnectorArn, region | MaxResults, NextToken | Lists the templates, if any, that are associated with a connector. |
get_template | select | template_arn, region | Retrieves a certificate template that the connector uses to issue certificates from a private CA. | |
create_template | insert | region, ConnectorArn | Creates an Active Directory compatible certificate template. The connectors issues certificates using these templates based on the requester’s Active Directory group membership. | |
update_template | update | template_arn, region | Update template configuration to define the information included in certificates. | |
delete_template | delete | template_arn, region | Deletes a template. Certificates issued using the template are still valid until they are revoked or expired. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
ConnectorArn | string | The Amazon Resource Name (ARN) that was returned when you called CreateConnector. |
region | string | AWS region (default: us-east-1) |
template_arn | string | The Amazon Resource Name (ARN) that was returned when you called CreateTemplate. |
MaxResults | integer | Use this parameter when paginating results to specify the maximum number of items to return in the response on each page. If additional items exist beyond the number you specify, the NextToken element is sent in the response. Use this NextToken value in a subsequent request to retrieve additional items. |
NextToken | string | Use this parameter when paginating results in a subsequent request after you receive a response with truncated results. Set it to the value of the NextToken parameter from the response you just received. |
SELECT examples
- list_templates
- get_template
Lists the templates, if any, that are associated with a connector.
SELECT
arn,
connector_arn,
created_at,
definition,
name,
object_identifier,
policy_schema,
revision,
status,
updated_at
FROM aws.pca_connector_ad.templates
WHERE ConnectorArn = '{{ ConnectorArn }}' -- required
AND region = '{{ region }}' -- required
AND MaxResults = '{{ MaxResults }}'
AND NextToken = '{{ NextToken }}'
;
Retrieves a certificate template that the connector uses to issue certificates from a private CA.
SELECT
arn,
connector_arn,
created_at,
definition,
name,
object_identifier,
policy_schema,
revision,
status,
updated_at
FROM aws.pca_connector_ad.templates
WHERE template_arn = '{{ template_arn }}' -- required
AND region = '{{ region }}' -- required
;
INSERT examples
- create_template
- Manifest
Creates an Active Directory compatible certificate template. The connectors issues certificates using these templates based on the requester’s Active Directory group membership.
INSERT INTO aws.pca_connector_ad.templates (
ClientToken,
ConnectorArn,
Definition,
Name,
Tags,
region
)
SELECT
'{{ ClientToken }}',
'{{ ConnectorArn }}' /* required */,
'{{ Definition }}',
'{{ Name }}',
'{{ Tags }}',
'{{ region }}'
RETURNING
template_arn
;
# Description fields are for documentation purposes
- name: templates
props:
- name: region
value: "{{ region }}"
description: Required parameter for the templates resource.
- name: ClientToken
value: "{{ ClientToken }}"
- name: ConnectorArn
value: "{{ ConnectorArn }}"
- name: Definition
description: |
Template configuration to define the information included in certificates. Define certificate validity and renewal periods, certificate request handling and enrollment options, key usage extensions, application policies, and cryptography settings.
value:
TemplateV2:
CertificateValidity:
RenewalPeriod:
Period: {{ Period }}
PeriodType: "{{ PeriodType }}"
ValidityPeriod:
Period: {{ Period }}
PeriodType: "{{ PeriodType }}"
EnrollmentFlags:
EnableKeyReuseOnNtTokenKeysetStorageFull: {{ EnableKeyReuseOnNtTokenKeysetStorageFull }}
IncludeSymmetricAlgorithms: {{ IncludeSymmetricAlgorithms }}
NoSecurityExtension: {{ NoSecurityExtension }}
RemoveInvalidCertificateFromPersonalStore: {{ RemoveInvalidCertificateFromPersonalStore }}
UserInteractionRequired: {{ UserInteractionRequired }}
Extensions:
ApplicationPolicies:
Critical: {{ Critical }}
Policies:
- PolicyObjectIdentifier: "{{ PolicyObjectIdentifier }}"
PolicyType: "{{ PolicyType }}"
KeyUsage:
Critical: {{ Critical }}
UsageFlags:
DataEncipherment: {{ DataEncipherment }}
DigitalSignature: {{ DigitalSignature }}
KeyAgreement: {{ KeyAgreement }}
KeyEncipherment: {{ KeyEncipherment }}
NonRepudiation: {{ NonRepudiation }}
GeneralFlags:
AutoEnrollment: {{ AutoEnrollment }}
MachineType: {{ MachineType }}
PrivateKeyAttributes:
CryptoProviders:
- "{{ CryptoProviders }}"
KeySpec: "{{ KeySpec }}"
MinimalKeyLength: {{ MinimalKeyLength }}
PrivateKeyFlags:
ClientVersion: "{{ ClientVersion }}"
ExportableKey: {{ ExportableKey }}
StrongKeyProtectionRequired: {{ StrongKeyProtectionRequired }}
SubjectNameFlags:
RequireCommonName: {{ RequireCommonName }}
RequireDirectoryPath: {{ RequireDirectoryPath }}
RequireDnsAsCn: {{ RequireDnsAsCn }}
RequireEmail: {{ RequireEmail }}
SanRequireDirectoryGuid: {{ SanRequireDirectoryGuid }}
SanRequireDns: {{ SanRequireDns }}
SanRequireDomainDns: {{ SanRequireDomainDns }}
SanRequireEmail: {{ SanRequireEmail }}
SanRequireSpn: {{ SanRequireSpn }}
SanRequireUpn: {{ SanRequireUpn }}
SupersededTemplates:
- "{{ SupersededTemplates }}"
TemplateV3:
CertificateValidity:
RenewalPeriod:
Period: {{ Period }}
PeriodType: "{{ PeriodType }}"
ValidityPeriod:
Period: {{ Period }}
PeriodType: "{{ PeriodType }}"
EnrollmentFlags:
EnableKeyReuseOnNtTokenKeysetStorageFull: {{ EnableKeyReuseOnNtTokenKeysetStorageFull }}
IncludeSymmetricAlgorithms: {{ IncludeSymmetricAlgorithms }}
NoSecurityExtension: {{ NoSecurityExtension }}
RemoveInvalidCertificateFromPersonalStore: {{ RemoveInvalidCertificateFromPersonalStore }}
UserInteractionRequired: {{ UserInteractionRequired }}
Extensions:
ApplicationPolicies:
Critical: {{ Critical }}
Policies:
- PolicyObjectIdentifier: "{{ PolicyObjectIdentifier }}"
PolicyType: "{{ PolicyType }}"
KeyUsage:
Critical: {{ Critical }}
UsageFlags:
DataEncipherment: {{ DataEncipherment }}
DigitalSignature: {{ DigitalSignature }}
KeyAgreement: {{ KeyAgreement }}
KeyEncipherment: {{ KeyEncipherment }}
NonRepudiation: {{ NonRepudiation }}
GeneralFlags:
AutoEnrollment: {{ AutoEnrollment }}
MachineType: {{ MachineType }}
HashAlgorithm: "{{ HashAlgorithm }}"
PrivateKeyAttributes:
Algorithm: "{{ Algorithm }}"
CryptoProviders:
- "{{ CryptoProviders }}"
KeySpec: "{{ KeySpec }}"
KeyUsageProperty:
PropertyFlags:
Decrypt: {{ Decrypt }}
KeyAgreement: {{ KeyAgreement }}
Sign: {{ Sign }}
PropertyType: "{{ PropertyType }}"
MinimalKeyLength: {{ MinimalKeyLength }}
PrivateKeyFlags:
ClientVersion: "{{ ClientVersion }}"
ExportableKey: {{ ExportableKey }}
RequireAlternateSignatureAlgorithm: {{ RequireAlternateSignatureAlgorithm }}
StrongKeyProtectionRequired: {{ StrongKeyProtectionRequired }}
SubjectNameFlags:
RequireCommonName: {{ RequireCommonName }}
RequireDirectoryPath: {{ RequireDirectoryPath }}
RequireDnsAsCn: {{ RequireDnsAsCn }}
RequireEmail: {{ RequireEmail }}
SanRequireDirectoryGuid: {{ SanRequireDirectoryGuid }}
SanRequireDns: {{ SanRequireDns }}
SanRequireDomainDns: {{ SanRequireDomainDns }}
SanRequireEmail: {{ SanRequireEmail }}
SanRequireSpn: {{ SanRequireSpn }}
SanRequireUpn: {{ SanRequireUpn }}
SupersededTemplates:
- "{{ SupersededTemplates }}"
TemplateV4:
CertificateValidity:
RenewalPeriod:
Period: {{ Period }}
PeriodType: "{{ PeriodType }}"
ValidityPeriod:
Period: {{ Period }}
PeriodType: "{{ PeriodType }}"
EnrollmentFlags:
EnableKeyReuseOnNtTokenKeysetStorageFull: {{ EnableKeyReuseOnNtTokenKeysetStorageFull }}
IncludeSymmetricAlgorithms: {{ IncludeSymmetricAlgorithms }}
NoSecurityExtension: {{ NoSecurityExtension }}
RemoveInvalidCertificateFromPersonalStore: {{ RemoveInvalidCertificateFromPersonalStore }}
UserInteractionRequired: {{ UserInteractionRequired }}
Extensions:
ApplicationPolicies:
Critical: {{ Critical }}
Policies:
- PolicyObjectIdentifier: "{{ PolicyObjectIdentifier }}"
PolicyType: "{{ PolicyType }}"
KeyUsage:
Critical: {{ Critical }}
UsageFlags:
DataEncipherment: {{ DataEncipherment }}
DigitalSignature: {{ DigitalSignature }}
KeyAgreement: {{ KeyAgreement }}
KeyEncipherment: {{ KeyEncipherment }}
NonRepudiation: {{ NonRepudiation }}
GeneralFlags:
AutoEnrollment: {{ AutoEnrollment }}
MachineType: {{ MachineType }}
HashAlgorithm: "{{ HashAlgorithm }}"
PrivateKeyAttributes:
Algorithm: "{{ Algorithm }}"
CryptoProviders:
- "{{ CryptoProviders }}"
KeySpec: "{{ KeySpec }}"
KeyUsageProperty:
PropertyFlags:
Decrypt: {{ Decrypt }}
KeyAgreement: {{ KeyAgreement }}
Sign: {{ Sign }}
PropertyType: "{{ PropertyType }}"
MinimalKeyLength: {{ MinimalKeyLength }}
PrivateKeyFlags:
ClientVersion: "{{ ClientVersion }}"
ExportableKey: {{ ExportableKey }}
RequireAlternateSignatureAlgorithm: {{ RequireAlternateSignatureAlgorithm }}
RequireSameKeyRenewal: {{ RequireSameKeyRenewal }}
StrongKeyProtectionRequired: {{ StrongKeyProtectionRequired }}
UseLegacyProvider: {{ UseLegacyProvider }}
SubjectNameFlags:
RequireCommonName: {{ RequireCommonName }}
RequireDirectoryPath: {{ RequireDirectoryPath }}
RequireDnsAsCn: {{ RequireDnsAsCn }}
RequireEmail: {{ RequireEmail }}
SanRequireDirectoryGuid: {{ SanRequireDirectoryGuid }}
SanRequireDns: {{ SanRequireDns }}
SanRequireDomainDns: {{ SanRequireDomainDns }}
SanRequireEmail: {{ SanRequireEmail }}
SanRequireSpn: {{ SanRequireSpn }}
SanRequireUpn: {{ SanRequireUpn }}
SupersededTemplates:
- "{{ SupersededTemplates }}"
- name: Name
value: "{{ Name }}"
- name: Tags
value: "{{ Tags }}"
UPDATE examples
- update_template
Update template configuration to define the information included in certificates.
UPDATE aws.pca_connector_ad.templates
SET
Definition = '{{ Definition }}',
ReenrollAllCertificateHolders = {{ ReenrollAllCertificateHolders }}
WHERE
template_arn = '{{ template_arn }}' --required
AND region = '{{ region }}' --required;
DELETE examples
- delete_template
Deletes a template. Certificates issued using the template are still valid until they are revoked or expired.
DELETE FROM aws.pca_connector_ad.templates
WHERE template_arn = '{{ template_arn }}' --required
AND region = '{{ region }}' --required
;