Skip to content

Commit

Permalink
Improved documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
hekonsek committed Sep 16, 2019
1 parent 4028a99 commit 257d1bb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Makefile
@@ -1,6 +1,6 @@
all: build

VERSION=0.4.0
VERSION=0.5.0

build:
GO111MODULE=on go build awsom-cloudformation-certificate.go
Expand Down
7 changes: 4 additions & 3 deletions awsom-cloudformation-certificate.go
Expand Up @@ -48,9 +48,10 @@ func certificateResource(ctx context.Context, event cfn.Event) (physicalResource
}
for _, cert := range certificates.CertificateSummaryList {
if *cert.CertificateArn == event.PhysicalResourceID {
if *cert.DomainName != domain {
fmt.Printf("Domain %s has been changed to %s. Updating resource.\n", *cert.DomainName, domain)
err = deleteValidatedCertificate(domain, hostedZone)
existingDomainName := *cert.DomainName
if existingDomainName != domain {
fmt.Printf("Domain %s has been changed to %s. Updating resource.\n", existingDomainName, domain)
err = deleteValidatedCertificate(existingDomainName, hostedZone)
if err != nil {
e = err
return
Expand Down
12 changes: 8 additions & 4 deletions readme.md
@@ -1,6 +1,6 @@
# Validated ACM certificate resource for AWS CloudFormation

[![Version](https://img.shields.io/badge/Awsom%20Resource%20Certificate-0.4.0-blue.svg)](https://github.com/hekonsek/awsom-resource-certificate/releases)
[![Version](https://img.shields.io/badge/Awsom%20Resource%20Certificate-0.5.0-blue.svg)](https://github.com/hekonsek/awsom-resource-certificate/releases)

This is custom CloudFormation resource for validated [ACM](https://aws.amazon.com/certificate-manager) HTTPS/CA certificate. It
creates ACM request together with DNS CNAME recordset in Route53 for validation purposes. The resource creation process
Expand All @@ -19,10 +19,14 @@ Certificate:

## Usage

The latest release of this resource can be found [here](s3://capsilon-awsom/awsom-cloudformation-certificate-0.4.0.zip).
The latest release of this resource can be found [here](s3://capsilon-awsom/awsom-cloudformation-certificate-0.5.0.zip).
I can't promise this hosting site will be available in the future, so I highly recommend to download the zip file and
host it in your own S3 bucket.

Here is the list of properties available for this resource:
- `Domain` - Mandatory. ACM domain. For example `*.subdomain.example.com` .
- `HostedZone` - Mandatory. Name of the hosted zone that will be used to perform DNS challenge. For example `example.com` .

In order to use this resource you have to define its definition as a Lambda in the first place. This is standard
practice for custom CloudFormation resources.

Expand Down Expand Up @@ -61,9 +65,9 @@ Resources:
Handler: awsom-cloudformation-certificate
Code:
S3Bucket: capsilon-awsom
S3Key: awsom-cloudformation-certificate-0.4.0.zip
S3Key: awsom-cloudformation-certificate-0.5.0.zip
Role: !Sub ${CloudFormationCertificateResourceRole.Arn}
Timeout: 1200
Timeout: 900
Certificate:
Type: Custom::Certificate
Expand Down

0 comments on commit 257d1bb

Please sign in to comment.