Giter Site home page Giter Site logo

m0uneer / cfn-certificate-provider Goto Github PK

View Code? Open in Web Editor NEW

This project forked from binxio/cfn-certificate-provider

0.0 2.0 0.0 52 KB

A custom CloudFormation resource provider for creating DNS validated certificates in AWS

License: Apache License 2.0

Shell 7.37% Makefile 25.75% Python 66.88%

cfn-certificate-provider's Introduction

Custom Certificate Provider with DNS validation support

AWS Certificate Manager is a great service that allows the creation and renewal of certificates to be automated. It provides two ways of validating a certificate request: through email and through DNS.

When you are creating immutable infrastructure, the email validation method is a no-go as it requires human intervention. The DNS validation is of course the way to go! With 'Route53' we have full control over the DNS domain and can create the required records.

Although the CloudFormation AWS::CertificateManager::Certificate resource allow you to specify that you want DNS validation, it does not reveal the DNS records that you need to create. It writes them in the CloudFormation log file so that another human has to collect them and manually update the DNS record.

With this custom provider you can fully automated the creation of certificates with CloudFormation!

How do I request certificates fully automatically?

As a prerequisite, you need to have the hosted zones for the domain names on your certificate in Route53. If you have that, you can fully automate the provisioning of certificates, with the following resources:

  1. Custom::Certificate to request a certificate without waiting for it to be issued
  2. Custom::CertificateDNSRecord which will obtain the DNS record for a domain name on the certificate.
  3. Custom::IssuedCertificate which will activately wait until the certificate is issued.
  4. AWS::Route53::ResourceRecordSet to create the validation DNS record.

Checkout the sample in cloudformation/demo-stack.yaml.

Installation

To install this custom resource, type:

aws cloudformation create-stack \
	--capabilities CAPABILITY_IAM \
	--stack-name cfn-certificate-provider \
	--template-body file://cloudformation/cfn-resource-provider.yaml 

aws cloudformation wait stack-create-complete  --stack-name cfn-certificate-provider 

This CloudFormation template will use our pre-packaged provider from s3://binxio-public-${AWS_REGION}/lambdas/cfn-certificate-provider-0.2.3.zip.

Demo

To install the simple sample of the Custom Resource, type:

read -p "domain name: " DOMAIN_NAME
read -p "hosted zone id: " HOSTED_ZONE
aws cloudformation create-stack --stack-name cfn-certificate-provider-demo \
	--template-body file://cloudformation/demo-stack.yaml \
	--parameters ParameterKey=DomainName,ParameterValue=$DOMAIN_NAME \
		     ParameterKey=HostedZoneId,ParameterValue=$HOSTED_ZONE
aws cloudformation wait stack-create-complete  --stack-name cfn-certificate-provider-demo

cfn-certificate-provider's People

Contributors

mvanholsteijn avatar rhattersley avatar spg avatar tader avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.