The AWS module is designed to support the AWS cloud. It will
probably only ever support a small portion of the cloud infrastructure, and other modules
will be created to support other portions of the AWS cloud (which is now very big).
For the foreseeable future, this module will only implement those features which are needed
to support existing projects. There is no plan to support even a consistent subset of AWS
functionality.
Extension Points
dns-asserter - this is an extension point which allows modules to
specify a means of asserting that they control a DNS name. It is needed to support the workflow
to create a certificate.
Target Verbs
cloudfront.invalidate <expr> - invalidate an existing cloudfront
distribution by id. The id will need to be
recovered by some means, e.g. looking up a cloudfront distribution by name.
lambda.addPermissions <name> - add permissions to a lambda. This
is a specific lambda operation and is not about adding permissions to its
role. It is specifically used to add permissions allowing the API Gateway to invoke the lambda. The
provided name is a name associated with the permission and is not a reference to a pre-existing object.
The inner scope of this declaration are policy statements, typically allow.
lambda.publishVersion - publish the "current" version of the lambda. That is,
publish a new version of the lambda, referencing the current state of code and configuration. It takes
two nested arguments: Name (the lambda function name or ARN) and optionally an
Alias, in which case the named alias will be updated with the provided version.
Composites
cloudfront.distribution.fromS3 <name> - create a cloudfront distribution
along with all the necessary components to make it work.
Bucket - the bucket or bucket ARN from which to retrieve
the files to distribute.
Certificate - the ARN of a certificate in the ACM certificate manager to be associated
with the distribution.
Comment - a string value to attach to the Comment field
on the distribution object.
Domain - a list of string values which represent the custom domains
to be associated with the distribution.
MinTTL - a time value which determines the minimum lifetime of content
served by the distribution.
CacheBehaviors - a list of objects to describe the response values for
various types of content by path.
TargetOriginId - a unique string that is used to tie together various parts
of the cache policy and behavior.
lambda.function <name> - create a lambda function, together with
a version and alias.
Runtime - a string describing the desired runtime. Any of the indicated runtimes
in the AWS manual are accepted. "go" is also accepted as a synonym for "provided.al2023".
Code - a location indicating where the code is going to come from. Typically,
this will use the aws.S3.Location interpreter to define it using
a Bucket and Key.
Role - every lambda needs a role to operate as, giving it permissions
to execute. This can be simply the ARN of a pre-existing role, or it can be an inline
definition of the role using the aws.IAM.WithRole interpreter.
PublishVersion - a boolean indicating if the current configuration should be
published as a new version.
Alias - a string value indicating that the current version should be
published as an alias with this name.
VpcConfig - a configuration, usually defined with the aws.VPC.Config
interpreter, that specifies the VPC configuration to place the lambda in. If not present, the
lambda is not placed in a VPC.
api.gatewayV2 <name> - create an APIGatewayV2 with all the necessary components.
Protocol - select the type of gateway you wish to create: "http" or "websocket".
IpAddressType - select the IP Address Protocols to be supported by the
gateway: "ipv4"", "ipv6" or "dualstack".
integration <name> - select a suitable integration type for the backend
of the gateway. The appropriate values are included in the nested block.
route <path> <integration> - define a route based on its
declared path and the integration name to associate with it.
stage <name> - request that a stage be created for the gateway with the given name.
This will automatically cause the gateway to be deployed to that stage.
Blanks
aws.ApiGatewayV2.Api <name> - an APIGatewayV2 blank.
Protocol - select the type of gateway you wish to create: "http" or "websocket".
aws.ApiGatewayV2.Deployment <name> - an APIGatewayV2 deployment blank.
Api - the id of the associated Api object.
aws.ApiGatewayV2.Integration <name> - an APIGatewayV2 integration blank. This
provides one of potentially many ways of connecting API requests to backend services (e.g. lambdas).
Api - the id of the associated Api object.
Region - the region in which the associated lambda is to be found.
PayloadFormatVersion - the payload format version (1.0 or 2.0); only applicable to HTTP protocole.
Type - the integration type. Use
AWS_PROXY
for lambda.
Uri - the Uri of the corresponding resource, e.g. the ARN of a lambda.
aws.ApiGatewayV2.Route <path> - an APIGatewayV2 route blank. The
route
here is a means of describing the action to be performed in order to invoke
the route. For http routes, this is something like
"GET /index"
; and for websocket
routes it is a content expression such as
$default
.
Api - the id of the associated Api object.
Target - an appropriate URL for the recipient lambda, which can be obtained by
invoking the
integrationId
method on a lambda object.
aws.ApiGatewayV2.Stage <name> - an APIGatewayV2 stage blank. This represents
a stage such as
development
or
production
.
Api - the id of the associated Api object.
awa.ApiGatewayV2.VPCLink <name> - an APIGatewayV2 vpc link. This represents
a link into a VPC.
Subnets - the subnets of the VPC to join.
SecurityGroups - the security groups of the VPC to apply.
aws.CertificateManager.Certificate <subject-name> - a certificate. The subject-name
is the default subject name for the certificate.
Domain - a domain object that can be used for validation.
SubjectAlternativeNames - a list of alternative names to include in the certificate.
ValidationMethod - how the ownership of the domain is going to be proved. "DNS" is the only
currently supported method.
ValidationProvider - the name of a mechanism for autoamatically validating the
DNS name.
aws.CloudFront.CacheBehavior <name> - a cache behavior descriptor that describes how
to cache certain types of content.
CachePolicy - the id of the cache policy to associate this behavior with.
PathPattern - a specific path pattern to match against the target files.
ResponseHeadersPolicy - the id of a response headers policy.
TargetOriginId - the id of the target origin (i.e. bucket).
aws.CloudFront.CachePolicy <name> - a cache policy descriptor to bundle together
cache behaviors.
MinTTL - the minimum time to live for documents retrieved from the bucket.
aws.CloudFront.Distribution <name> - a cloudfront distribution.
CacheBehaviors - the (list of) cache behavior objects to associate with the distribution.
CachePolicy - the cache policy to associate with the distribution.
Certificate - the id of a certificate to identify the website.
Comment - a comment about the distribution.
DefaultRoot - the default path to extract for the distribution when faced with an index request.
Domain - the (list of) domains to accept requests for.
OriginAccessControl - an object to describe the access control mechanism for the target.
OriginDNS - a DNS name describing the origin.
TargetOriginId - an id to associate with the target origin.
aws.CloudFront.OriginAccessControl <name> - an origin access control link between
a distribution and a bucket.
OriginAccessControlOriginType - the type of the OAC.
SigningBehavior - how to sign the requests to the bucket.
SigningProtocol - the protocol for signing the requests.
aws.CloudFront.ResponseHeadersPolicy <name> - a header to associate with a cache behavior.
Header - the header to set in the response.
Value - the value to set the header to.
aws.DynamoDB.Table <name> - a dynamodb table called name.
Fields - a list of field expressions, where each field is a pair of name and type,
There can also be an @Key adverb attached to individual fields to identify them as key fields.
The @Key adverb takes a parameter which can either be hash or range.
aws.IAM.Policy <name> - a manmaged policy with the given name.
Policy - a policy document (q.v.).
aws.IAM.Role <name> - a role for assumption.
Assume - a list of policy actions to allow the role to be assumed.
Inline - a list of policy actions which can be performed by the role once assumed.
aws.Lambda.Alias <name> - a lambda alias.
This can only be used as a finder - to create a new alias, use lambda.publishVersion.
aws.Lambda.Function <name> - a lambda function.
Code - a reference to the location of the code for the lambda, probably using the aws.S3.Location interpreter.
Handler - a definition for the handler (if required by language runtime).
Role - a role to attach to the lambda, possibly defined inline with aws.IAM.WithRole.
Runtime - a string definition of the runtime, which may also be provided as "go" to define the Go runtime.
VpcConfig - a VPC configuration, which can be defined inline with aws.VPC.Config.
aws.Neptune.Cluster <name> - a neptune cluster.
MaxCapacity - the maximum capacity to associate with a serverless cluster.
MinCapacity - the minimum capacity to associate with a serverless cluster.
SubnetGroupName - the name of a subnet group to identify the subnets on which the cluster will show up.
aws.Neptune.Instance <name> - a neptune instance.
Cluster - the cluster to associate the instance with.
InstanceClass - the class of the server to run (or "serverless").
aws.Neptune.SubnetGroup <name> - a neptune subnet group.
As yet, this does not support creating new subnet groups. This is just a missing feature.
aws.Route53.ALIAS <name> - a route53 ALIAS record.
AliasZone - the zone which is responsible for storing the node pointed to.
PointsTo - the name pointed to.
UpdateZone - the zone to update (i.e. insert the ALIAS record into).
aws.Route53.CNAME <name> - a route53 CNAME record.
PointsTo - the name pointed to.
Zone - the zone to update (i.e. insert the CNAME record into).
aws.Route53.DomainName <name> - a route53 domain name record.
Because of the complexity of creating domain names (and the fact that it costs money), creating
domain names is not supported by deployer. You can, however, find them by (domain) name.
aws.S3.Bucket <name> - an S3 bucket called name.
aws.VPC.VPC <name> - a VPC record.
As yet, this does not support creating new VPC objects. This is just a missing feature.
Interpreters
These interpreters allow individual properties to be set with compound values expressed succinctly.
aws.DynamoFields - parse a scope of field descriptions as a list.
field type - a pair of field name and field type.
@Key type - a nested adverb identifying key fields. The type can either be
hash or range.
aws.IAM.WithRole - parse a scope, definiting an inline role.
assume - introduce a nested scope which defines who can assume the role.
policy - introduce a nested scope which defines permissions granted to the role.
policy <name> - add a managed policy to the role (does not have a nested scope).
aws.S3.Location - identify a specify object in an S3 bucket.
Bucket - the name of the bucket.
Key - the object key in the bucket.
aws.VPC.Config - identify a specify object in an S3 bucket.
DualStack - specify if the VPC should use both IPv4 and IPv6.
Subnets - the list of subnets to associate with the VPC config.
SecurityGroups - the list of security groups to include in the VPC config.
Constants
aws.action.APIGateway.GET - "apigateway:GET"
aws.action.ec2.CreateNetworkInterface - "ec2:CreateNetworkInterface"
aws.action.ec2.DescribeNetworkInterfaces - "ec2:DescribeNetworkInterfaces"
aws.action.ec2.DeleteNetworkInterface - "ec2:DeleteNetworkInterface"
aws.action.S3.GetObject - "s3:GetObject"
aws.action.S3.PutObject - "s3:PutObject"
aws.principal.AWS - "AWS"
aws.principal.CloudFront - "cloudfront.amazonaws.com"
aws.principal.Service - "Service"
aws.resource.APIGatewayV2 - "arn:aws:apigateway:us-east-1::/apis"
aws.cond.StringEquals - "StringEquals"
aws.SourceArn - "aws:SourceArn"