Documentation
¶
Overview ¶
Example (Api) ¶
c := &Config{
Config: &up.Config{
Name: "polls",
},
}
dump(c, "Api")
Output: { "Properties": { "BinaryMediaTypes": [ "*/*" ], "Description": "Managed by Up.", "Name": { "Ref": "Name" } }, "Type": "AWS::ApiGateway::RestApi" }
Example (ApiProxyMethod) ¶
c := &Config{
Config: &up.Config{
Name: "polls",
},
}
dump(c, "ApiProxyMethod")
Output: { "Properties": { "AuthorizationType": "NONE", "HttpMethod": "ANY", "Integration": { "IntegrationHttpMethod": "POST", "Type": "AWS_PROXY", "Uri": { "Fn::Join": [ "", [ "arn:aws:apigateway:", { "Ref": "AWS::Region" }, ":lambda:path/2015-03-31/functions/", { "Fn::Join": [ ":", [ "arn", "aws", "lambda", { "Ref": "AWS::Region" }, { "Ref": "AWS::AccountId" }, "function", { "Fn::Join": [ ":", [ { "Ref": "FunctionName" }, "${stageVariables.qualifier}" ] ] } ] ] }, "/invocations" ] ] } }, "ResourceId": { "Ref": "ApiProxyResource" }, "RestApiId": { "Ref": "Api" } }, "Type": "AWS::ApiGateway::Method" }
Example (ApiProxyResource) ¶
c := &Config{
Config: &up.Config{
Name: "polls",
},
}
dump(c, "ApiProxyResource")
Output: { "Properties": { "ParentId": { "Fn::GetAtt": [ "Api", "RootResourceId" ] }, "PathPart": "{proxy+}", "RestApiId": { "Ref": "Api" } }, "Type": "AWS::ApiGateway::Resource" }
Example (ApiRootMethod) ¶
c := &Config{
Config: &up.Config{
Name: "polls",
},
}
dump(c, "ApiRootMethod")
Output: { "Properties": { "AuthorizationType": "NONE", "HttpMethod": "ANY", "Integration": { "IntegrationHttpMethod": "POST", "Type": "AWS_PROXY", "Uri": { "Fn::Join": [ "", [ "arn:aws:apigateway:", { "Ref": "AWS::Region" }, ":lambda:path/2015-03-31/functions/", { "Fn::Join": [ ":", [ "arn", "aws", "lambda", { "Ref": "AWS::Region" }, { "Ref": "AWS::AccountId" }, "function", { "Fn::Join": [ ":", [ { "Ref": "FunctionName" }, "${stageVariables.qualifier}" ] ] } ] ] }, "/invocations" ] ] } }, "ResourceId": { "Fn::GetAtt": [ "Api", "RootResourceId" ] }, "RestApiId": { "Ref": "Api" } }, "Type": "AWS::ApiGateway::Method" }
Example (DnsZone) ¶
c := &Config{
Config: &up.Config{
Name: "polls",
DNS: config.DNS{
Zones: []*config.Zone{
{
Name: "up-example.com",
},
},
},
},
}
dump(c, "DnsZoneUpExampleCom")
Output: { "DeletionPolicy": "Retain", "Properties": { "Name": "up-example.com" }, "Type": "AWS::Route53::HostedZone", "UpdateReplacePolicy": "Retain" }
Example (DnsZoneRecord) ¶
c := &Config{
Config: &up.Config{
Name: "polls",
DNS: config.DNS{
Zones: []*config.Zone{
{
Name: "up-example.com",
Records: []*config.Record{
{
Name: "blog.up-example.com",
Type: "CNAME",
TTL: 600,
Value: []string{"example.medium.com"},
},
},
},
},
},
},
}
dump(c, "DnsZoneUpExampleComRecordBlogUpExampleComCNAME")
Output: { "Properties": { "Comment": "Managed by Up.", "HostedZoneId": { "Ref": "DnsZoneUpExampleCom" }, "Name": "blog.up-example.com", "ResourceRecords": [ "example.medium.com" ], "TTL": "600", "Type": "CNAME" }, "Type": "AWS::Route53::RecordSet" }
Example (StageAlias) ¶
c := &Config{
Config: &up.Config{
Name: "polls",
Stages: config.Stages{
"production": &config.Stage{
Name: "production",
},
},
},
Versions: Versions{
"production": "15",
},
}
dump(c, "ApiFunctionAliasProduction")
Output: { "Properties": { "Description": "Managed by Up.", "FunctionName": { "Ref": "FunctionName" }, "FunctionVersion": "15", "Name": "production" }, "Type": "AWS::Lambda::Alias" }
Example (StageDNSZone) ¶
c := &Config{
Config: &up.Config{
Name: "polls",
Stages: config.Stages{
"production": &config.Stage{
Name: "production",
Domain: "up-example.com",
},
},
},
Versions: Versions{
"production": "15",
},
}
dump(c, "DnsZoneUpExampleCom")
Output: { "DeletionPolicy": "Retain", "Properties": { "Name": "up-example.com" }, "Type": "AWS::Route53::HostedZone", "UpdateReplacePolicy": "Retain" }
Example (StageDNSZoneRecord) ¶
c := &Config{
Config: &up.Config{
Name: "polls",
Stages: config.Stages{
"production": &config.Stage{
Name: "production",
Domain: "up-example.com",
},
},
},
Versions: Versions{
"production": "15",
},
}
dump(c, "DnsZoneUpExampleComRecordUpExampleCom")
Output: { "Properties": { "AliasTarget": { "DNSName": { "Fn::GetAtt": [ "ApiDomainProduction", "DistributionDomainName" ] }, "HostedZoneId": "Z2FDTNDATAQYW2" }, "Comment": "Managed by Up.", "HostedZoneId": { "Ref": "DnsZoneUpExampleCom" }, "Name": "up-example.com", "Type": "A" }, "Type": "AWS::Route53::RecordSet" }
Example (StageDeployment) ¶
c := &Config{
Config: &up.Config{
Name: "polls",
Stages: config.Stages{
"production": &config.Stage{
Name: "production",
},
},
},
Versions: Versions{
"production": "15",
},
}
dump(c, "ApiDeploymentProduction")
Output: { "DependsOn": [ "ApiRootMethod", "ApiProxyMethod", "ApiFunctionAliasProduction" ], "Properties": { "RestApiId": { "Ref": "Api" }, "StageDescription": { "Variables": { "qualifier": "production" } }, "StageName": "production" }, "Type": "AWS::ApiGateway::Deployment" }
Example (StageDomain) ¶
c := &Config{
Config: &up.Config{
Name: "polls",
Stages: config.Stages{
"production": &config.Stage{
Name: "production",
Domain: "up-example.com",
Cert: "arn::something",
},
},
},
Versions: Versions{
"production": "15",
},
}
dump(c, "ApiDomainProduction")
Output: { "Properties": { "CertificateArn": "arn::something", "DomainName": "up-example.com" }, "Type": "AWS::ApiGateway::DomainName" }
Example (StagePathMapping) ¶
c := &Config{
Config: &up.Config{
Name: "polls",
Stages: config.Stages{
"production": &config.Stage{
Name: "production",
Domain: "up-example.com",
},
},
},
Versions: Versions{
"production": "15",
},
}
dump(c, "ApiDomainProductionPathMapping")
Output: { "DependsOn": [ "ApiDeploymentProduction", "ApiDomainProduction" ], "Properties": { "BasePath": "", "DomainName": "up-example.com", "RestApiId": { "Ref": "Api" }, "Stage": "production" }, "Type": "AWS::ApiGateway::BasePathMapping" }
Example (StagePermission) ¶
c := &Config{
Config: &up.Config{
Name: "polls",
Stages: config.Stages{
"production": &config.Stage{
Name: "production",
},
},
},
Versions: Versions{
"production": "15",
},
}
dump(c, "ApiLambdaPermissionProduction")
Output: { "DependsOn": "ApiFunctionAliasProduction", "Properties": { "Action": "lambda:invokeFunction", "FunctionName": { "Fn::Join": [ ":", [ "arn", "aws", "lambda", { "Ref": "AWS::Region" }, { "Ref": "AWS::AccountId" }, "function", { "Fn::Join": [ ":", [ { "Ref": "FunctionName" }, "production" ] ] } ] ] }, "Principal": "apigateway.amazonaws.com", "SourceArn": { "Fn::Join": [ "", [ "arn:aws:execute-api", ":", { "Ref": "AWS::Region" }, ":", { "Ref": "AWS::AccountId" }, ":", { "Ref": "Api" }, "/*" ] ] } }, "Type": "AWS::Lambda::Permission" }
Index ¶
Examples ¶
- Package (Api)
- Package (ApiProxyMethod)
- Package (ApiProxyResource)
- Package (ApiRootMethod)
- Package (DnsZone)
- Package (DnsZoneRecord)
- Package (StageAlias)
- Package (StageDNSZone)
- Package (StageDNSZoneRecord)
- Package (StageDeployment)
- Package (StageDomain)
- Package (StagePathMapping)
- Package (StagePermission)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// Zones already present in route53. This is used to
// ensure that existing zones previously set up, or
// automatically configured when purchasing a domain
// are not duplicated.
Zones []*route53.HostedZone
// Versions map used to maintain the correct lambda
// function aliases when updating a stack.
Versions Versions
*up.Config
}
Config for the resource template.
Click to show internal directories.
Click to hide internal directories.