Skip to content

bagubagu/aws-cfn-custom-resources

Repository files navigation

AWS Cfn Custom Resources

This repo contain sources for Bagubagu's made AWS Custom Resources.

Custom Resource Arn
Custom::GetHostedZoneId arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:cfnGetHostedZoneId
please::add::more see::develop

Usage

First, you need to publish these custom resources into your AWS project account. Use the following launch button:

Launch Button

Then use the custom resources from cloudformation template.

Conditions:
  HostedZoneDoesNotExist: !Equals [!Ref GetHostedZoneId, ""]

Resources:
  GetHostedZoneId:
    Type: Custom::GetHostedZoneId
    Properties:
      HostedZone: monyet.com
      ServiceToken: !Sub "arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:cfnGetHostedZoneId"

  MyHostedZone:
    Type: AWS::Route53::HostedZone
    Condition: HostedZoneDoesNotExist
    Properties:
      Name: !Ref monyet.com

Develop

Requirements

Scripts

# deploy the lambdas into the account using cloudformation
npm run deploy

# remove the cloudformation stack
npm run delete

# develop with tdd
npm test

Directory structure:

.
├── README.md                   <-- This instructions file
├── package.json                <-- NodeJS dependencies
├── tsconfig.json               <-- Typescript configuration file
├── jest.config.js              <-- Jest configuration file
├── template.yml                <-- SAM template
├── src                         <-- Source codes in Typescript
│   └── get-hosted-zone-id
│       ├── get-hosted-zone-id.ts
│       └── __tests__
│           └── get-hosted-zone-id.spec.ts
├── dist                        <-- Autogenerated distribution codes
│   └── get-hosted-zone-id
│       └── get-hosted-zone-id.js

References:

notes:

cd dist
npm install --production --no-package-lock

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors