This plugin packages and deploys both CloudFormation and SAM templates with a security first mindset.
Github link: https://github.com/trek10inc/jenkins-aws-sam-plugin
This plugins adds Jenkins pipeline steps to interact with the AWS API.
- Navigate to your Jenkins server
- On the left, click
Manage Jenkins
- Scroll down to find
Manage Plugins
and click it - Look for the
AWS SAM
plugin
For deployment you'll need access to an S3 bucket (or permission to create one), CloudFormation and ChangeSet IAM lifecycle actions, as well as any IAM permissions required to create the resources in your SAM (CloudFormation) Template.
---
Version: '2012-10-17'
Statement:
- Sid: SAMS3Actions
Resource: '*'
Effect: Allow
Action:
- s3:CreateBucket
- s3:GetBucketLocation
- s3:ListBucket
- s3:PutObject
- s3:PutObjectAcl
- s3:PutObjectTagging
...
---
Version: '2012-10-17'
Statement:
- Sid: SAMCloudFormationActions
Resource: '*'
Effect: Allow
Action:
- cloudformation:ValidateTemplate
- cloudformation:DescribeStacks
- cloudformation:CreateChangeSet
- cloudformation:DescribeChangeSet
- cloudformation:ExecuteChangeSet
...
[TBD]
samDeploy([credentialsId: 'jenkins_sandbox', region: 'us-east-1', s3Bucket: 'sam-jenkins-plugin', stackName: 'sam-jenkins-plugin', parameters: [[key: 'Username', value: 'Modest']], templateFile: 'template.yml'])