Skip to content
Permalink
Browse files

fix stage mapping due to custom stage refactor

  • Loading branch information...
tj committed Feb 7, 2018
1 parent 8abb85e commit 2a7efcee5c0bcb3482cf63b07360022a22a3f841
@@ -276,17 +276,17 @@ func stageDomain(c *Config, s *config.Stage, m Map, deploymentID string) {
},
}

stagePathMapping(c, s, m, deploymentID)
stagePathMapping(c, s, m, deploymentID, id)
stageDNSRecord(c, s, m, id)
}

// stagePathMapping sets up the stage deployment mapping.
func stagePathMapping(c *Config, s *config.Stage, m Map, deploymentID string) {
func stagePathMapping(c *Config, s *config.Stage, m Map, deploymentID, domainID string) {
id := util.Camelcase("api_domain_%s_path_mapping", s.Name)

m[id] = Map{
"Type": "AWS::ApiGateway::BasePathMapping",
"DependsOn": deploymentID,
"DependsOn": []string{deploymentID, domainID},
"Properties": Map{
"DomainName": s.Domain,
"BasePath": util.BasePath(s.Path),
@@ -423,7 +423,10 @@ func Example_stagePathMapping() {
dump(c, "ApiDomainProductionPathMapping")
// Output:
// {
// "DependsOn": "ApiDeploymentProduction",
// "DependsOn": [
// "ApiDeploymentProduction",
// "ApiDomainProduction"
// ],
// "Properties": {
// "BasePath": "",
// "DomainName": "up-example.com",

0 comments on commit 2a7efce

Please sign in to comment.
You can’t perform that action at this time.