certificates
Creates, updates, deletes or gets a certificate resource or lists certificates in a region
Overview
| Name | certificates |
| Type | Resource |
| Description | Resource Type definition for AWS::Lightsail::Certificate. |
| Id | awscc.lightsail.certificates |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
certificate_name | string | The name for the certificate. |
domain_name | string | The domain name (e.g., example.com ) for the certificate. |
subject_alternative_names | array | An array of strings that specify the alternate domains (e.g., example2.com) and subdomains (e.g., blog.example.com) for the certificate. |
certificate_arn | string | |
status | string | The validation status of the certificate. |
tags | array | An array of key-value pairs to apply to this resource. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
certificate_name | string | The name for the certificate. |
region | string | AWS region. |
For more information, see AWS::Lightsail::Certificate.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | certificates | INSERT | CertificateName, DomainName, region |
delete_resource | certificates | DELETE | Identifier, region |
update_resource | certificates | UPDATE | Identifier, PatchDocument, region |
list_resources | certificates_list_only | SELECT | region |
get_resource | certificates | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual certificate.
SELECT
region,
certificate_name,
domain_name,
subject_alternative_names,
certificate_arn,
status,
tags
FROM awscc.lightsail.certificates
WHERE
region = 'us-east-1' AND
Identifier = '{{ certificate_name }}';
Lists all certificates in a region.
SELECT
region,
certificate_name
FROM awscc.lightsail.certificates_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new certificate resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.lightsail.certificates (
CertificateName,
DomainName,
region
)
SELECT
'{{ certificate_name }}',
'{{ domain_name }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.lightsail.certificates (
CertificateName,
DomainName,
SubjectAlternativeNames,
Tags,
region
)
SELECT
'{{ certificate_name }}',
'{{ domain_name }}',
'{{ subject_alternative_names }}',
'{{ tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: certificate
props:
- name: certificate_name
value: '{{ certificate_name }}'
- name: domain_name
value: '{{ domain_name }}'
- name: subject_alternative_names
value:
- '{{ subject_alternative_names[0] }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
UPDATE example
Use the following StackQL query and manifest file to update a certificate resource, using stack-deploy.
/*+ update */
UPDATE awscc.lightsail.certificates
SET PatchDocument = string('{{ {
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ certificate_name }}';
DELETE example
/*+ delete */
DELETE FROM awscc.lightsail.certificates
WHERE
Identifier = '{{ certificate_name }}' AND
region = 'us-east-1';
Permissions
To operate on the certificates resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
lightsail:CreateCertificate,
lightsail:GetCertificates,
lightsail:TagResource,
lightsail:UntagResource
lightsail:GetCertificates
lightsail:GetCertificates,
lightsail:TagResource,
lightsail:UntagResource
lightsail:DeleteCertificate,
lightsail:GetCertificates
lightsail:GetCertificates