Skip to content

Commit

Permalink
Ensure user Parameters are included in CF template
Browse files Browse the repository at this point in the history
Addresses: #34
  • Loading branch information
mweagle committed Dec 12, 2016
1 parent cfc68fb commit 344fd3c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 8 additions & 2 deletions apigateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,7 @@ func corsMethodResponseParams() map[string]bool {
// DefaultMethodResponses returns the default set of Method HTTPStatus->Response
// pass through responses. The successfulHTTPStatusCode param is the single
// 2XX response code to use for the method.
func methodResponses(userResponses map[int]*Response,
corsEnabled bool) *gocf.APIGatewayMethodMethodResponseList {
func methodResponses(userResponses map[int]*Response, corsEnabled bool) *gocf.APIGatewayMethodMethodResponseList {

var responses gocf.APIGatewayMethodMethodResponseList
for eachHTTPStatusCode, eachResponse := range userResponses {
Expand Down Expand Up @@ -505,6 +504,13 @@ func (api *API) export(serviceName string,
gocf.String("/invocations")),
},
}
if len(eachMethodDef.Parameters) != 0 {
requestParams := make(map[string]string, 0)
for eachKey, eachBool := range eachMethodDef.Parameters {
requestParams[eachKey] = fmt.Sprintf("%t", eachBool)
}
apiGatewayMethod.RequestParameters = requestParams
}

// Add the integration response RegExps
apiGatewayMethod.Integration.IntegrationResponses = integrationResponses(eachMethodDef.Integration.Responses,
Expand Down
2 changes: 0 additions & 2 deletions provision.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/iam"
"github.com/aws/aws-sdk-go/service/s3"
gocf "github.com/crewjam/go-cloudformation"
spartaAWS "github.com/mweagle/Sparta/aws"
)
Expand Down Expand Up @@ -285,7 +284,6 @@ func callWorkflowHook(hook WorkflowHook, ctx *workflowContext) error {
ctx.logger)
}


func versionAwareS3KeyName(s3DefaultKey string, s3VersioningEnabled bool, logger *logrus.Logger) (string, error) {
versionKeyName := s3DefaultKey
if !s3VersioningEnabled {
Expand Down

0 comments on commit 344fd3c

Please sign in to comment.