Documentation ¶
Overview ¶
Package aws provides terraform templates for Amazon Web Services (AWS)
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
var TEMPLATE_AWS_API_GATEWAY string
var TEMPLATE_AWS_CLOUDFRONT_DISTRIBUTION string
var TEMPLATE_AWS_IAM_POLICY string
var TEMPLATE_AWS_LAMBDA_FUNCTION string
var TEMPLATE_AWS_ROUTE53_ZONE string
var TEMPLATE_AWS_S3_BUCKET string
var TEMPLATE_AWS_SECURITY_GROUP string
var TEMPLATE_AWS_VPC string
Functions ¶
This section is empty.
Types ¶
type APIGateway ¶
type APIGateway struct { LogGroupArn string `help:"If a CloudWatch log group already exists, put its arn here" short:"a" xor:"LogGroupArn,CreateLogGroup" required:""` Name string `help:"API gateway name" required:"" default:"Fusion API gateway"` CreateLogGroup bool `` /* 175-byte string literal not displayed */ }
View the Kong CLI docs to see options for your command's flags and arguments https://github.com/alecthomas/kong#flags
type CloudfrontDistribution ¶
type CloudfrontDistribution struct { LoggingBucketName string `help:"Name for a new s3 bucket that will contain all cloudfront logs"` OriginBucketName string `help:"Name of the origin s3 bucket"` CloudfrontAlias string `help:"DNS alias for cloudfront"` }
View the Kong CLI docs to see options for your command's flags and arguments https://github.com/alecthomas/kong#flags
type IamPolicy ¶
type IamPolicy struct { Name string `help:"Name of the IAM policy" required:""` Description string `help:"Description of the IAM policy" default:"" short:"d"` Path string `help:"Path of the IAM Policy" default:"/" short:"p"` PolicyJSON interface{} `help:"Body of the IAM policy via json file" required:"" short:"j" type:"jsonfile"` }
View the Kong CLI docs to see options for your command's flags and arguments https://github.com/alecthomas/kong#flags
func (*IamPolicy) Render ¶
Render generates the Terraform code for the IamPolicy
Example ¶
policy := &IamPolicy{ Name: "example-policy", Description: "A policy description", PolicyJSON: strings.TrimSpace(`{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "ec2:AttachVolume", "ec2:DetachVolume" ], "Resource": "arn:aws:ec2:*:*:instance/*", "Condition": { "StringEquals": {"aws:ResourceTag/Department": "Development"} } }, { "Effect": "Allow", "Action": [ "ec2:AttachVolume", "ec2:DetachVolume" ], "Resource": "arn:aws:ec2:*:*:volume/*", "Condition": { "StringEquals": {"aws:ResourceTag/VolumeUser": "${aws:username}"} } } ] }`), } err := policy.Render(os.Stdout, true) if err != nil { fmt.Println("failed to render policy", err) os.Exit(1) }
Output:
type LambdaFunction ¶
type LambdaFunction struct { Name string `help:"" default:"my_lambda"` Filename string `help:"" default:"my_lambda.zip"` Handler string `help:"" default:"handler.index.js"` Runtime string `help:"" default:"nodejs14.x"` }
LambdaFunction is the template data object used to create a lambda function
func NewLambdaFunction ¶
func NewLambdaFunction(name, filename, handler, runtime string) *LambdaFunction
NewLambdaFunction creates new lambda function
func (*LambdaFunction) Render ¶
func (resource *LambdaFunction) Render(w io.Writer, skipColor bool) error
Render generates the Terraform code for the LambdaFunction
Example ¶
lambda := &LambdaFunction{ Name: "example-function", Runtime: "node", Handler: "handler.index", Filename: "index.js", } err := lambda.Render(os.Stdout, true) if err != nil { fmt.Println("failed to render lambda", err) os.Exit(1) }
Output:
type Route53HostedZone ¶
type Route53HostedZone struct { Target string `help:"Target for the zone"` Zone string `help:"Zone name"` }
View the Kong CLI docs to see options for your command's flags and arguments https://github.com/alecthomas/kong#flags
type S3Bucket ¶
type S3Bucket struct { Name string `help:"Name of the S3 Bucket" default:"fusion-bucket" required:"true"` StaticSite bool `help:"Enable static website hosting from bucket"` ForceDestroy bool `help:"Destroy objects on bucket deletion" default:"false"` }
View the Kong CLI docs to see options for your command's flags and arguments https://github.com/alecthomas/kong#flags
type SecurityGroup ¶
type SecurityGroup struct { PublicIngressPort int `help:"Public ingress port for the security group"` PublicIngressProtocol string `help:"Public ingress protocol for the security group"` }
View the Kong CLI docs to see options for your command's flags and arguments https://github.com/alecthomas/kong#flags
type VPC ¶
type VPC struct { CidrBlock string `help:"CIDR block for the VPC, must be able to accomodate all the hosts the AZs will have" default:"10.0.0.0/16"` AzCount int `help:"Number of AZs to deploy in, will automatically distribute across AZs in that region" default:"4"` SubnetCapacity int `help:"Number of ip addresses per subnet" default:"256"` }
View the Kong CLI docs to see options for your command's flags and arguments https://github.com/alecthomas/kong#flags