Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS SAM Support #140

Open
oharaandrew314 opened this issue Mar 16, 2018 · 2 comments
Open

AWS SAM Support #140

oharaandrew314 opened this issue Mar 16, 2018 · 2 comments

Comments

@oharaandrew314
Copy link

Currently, I have my build tool download python and the aws cli to deploy my SAM template. My current deploy task looks like:

task packageSam(dependsOn: getTasksByName("shadowJar", true)) {
    doLast {
        exec {
            commandLine "aws", "cloudformation", "package", "--template-file", "service.yml", "--s3-bucket", deploymentBucketName, "--output-template-file", "service-out.yml"
        }
    }
}

task deploy(dependsOn: packageSam) {
    doLast {
        exec {
            commandLine "aws", "cloudformation", "deploy", "--template-file", "service-out.yml", "--stack-name", "my-service", "--parameter-overrides", "Stage=latest", "--capabilities", "CAPABILITY_IAM"
        }
    }
}

I think I'd be able to use this tool and eliminate the aws cli if it supported the cloudformation package and cloudformation deploy commands.

@ericraymond
Copy link

+1

@aaronp-hd
Copy link

I believe cloudformation package part can currently be replicated using the existing AmazonS3FileUploadTask, Gradle variables and CloudFormation parameters. For example, in my case I read an S3 bucket name and key from config, upload code for a Lambda function to S3 using the AmazonS3FileUploadTask with the given bucket and key, and pass the same key and bucket as CloudFormation parameters when deploying using awsCfnMigrateStack.

The cloudformation package command creates and executes a change set, which is required for templates containing transforms. I've added a similar Gradle task that does the same here: #146. I've done some testing and it works well for my use cases; would be good if others could take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants