stackbot/

directory
v1.10.6-3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2018 License: MIT, MIT

README

stackhand

A collection of CloudFormation custom resource Lambdas written in Go.

eawsy/aws-lambda-go-shim is used to provide a shim for running Go on the Python 2.7 runtime.

Lambdas

subnet_to_az

subnet_to_az retrieves the availability zone from a given subnet.

Handler:

handler.Handle

Properties:

Region: AWS region to search

SubnetId: ID of subnet to search for availability zone

Returns:

{
  "AvailabilityZone": "..."
}

Hosted at s3://cloudboss-public/lambda/co/cloudboss/stackhand/subnet_to_az/0.1.0/python2.7/subnet_to_az-0.1.0.zip.

CloudFormation example:

Parameters:
  SubnetId:
    Description: Subnet ID in VPC where cluster will be placed
    Type: AWS::EC2::Subnet::Id

Resources:
  # Deploy the Lambda
  SubnetToAzFunction:
    Type: AWS::Lambda::Function
    Properties:
      Code:
        S3Bucket: cloudboss-public
        S3Key: lambda/co/cloudboss/stackhand/subnet_to_az/0.1.0/python2.7/subnet_to_az-0.1.0.zip
      Handler: handler.Handle
      Runtime: python2.7
      Timeout: 30
      Role: !Ref LambdaExecutionRole

  # Run the Lambda as a custom resource
  SubnetToAz:
    Type: Custom::SubnetToAz
    DependsOn: SubnetToAzFunction
    Properties:
      ServiceToken: !GetAtt [SubnetToAzFunction, Arn]
      Region: !Ref AWS::Region
      SubnetId: !Ref SubnetId

  # Use its output with !GetAtt
  Volume:
    Type: AWS::EC2::Volume
    Properties:
      AvailabilityZone: !GetAtt [SubnetToAz, AvailabilityZone]
      Size: 10
      VolumeType: gp2

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL