https://github.com/rpstreef/terraform-aws-codepipeline-sam
Integrates Terraform with AWS SAM by using AWS CodePipeline to deploy a SAM application.
https://github.com/rpstreef/terraform-aws-codepipeline-sam
aws aws-codebuild aws-codedeploy aws-codepipeline aws-sam codepipeline serverless terraform terraform-module
Last synced: 6 months ago
JSON representation
Integrates Terraform with AWS SAM by using AWS CodePipeline to deploy a SAM application.
- Host: GitHub
- URL: https://github.com/rpstreef/terraform-aws-codepipeline-sam
- Owner: rpstreef
- License: apache-2.0
- Created: 2020-04-30T06:43:03.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-09-06T10:59:01.000Z (about 3 years ago)
- Last Synced: 2025-03-22T04:03:14.408Z (7 months ago)
- Topics: aws, aws-codebuild, aws-codedeploy, aws-codepipeline, aws-sam, codepipeline, serverless, terraform, terraform-module
- Language: HCL
- Homepage:
- Size: 75.2 KB
- Stars: 8
- Watchers: 3
- Forks: 11
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Terraform AWS CodePipeline for AWS SAM Applications
## About:
Deploys an AWS CodePipeline specifically designed for AWS SAM.
It requires these artifacts, amongst code obviously, in the source repository:
- AWS SAM template file (e.g. template.yaml), contains a description of your stack in CFL.
- CloudFormation Template configuration file (e.g. configuration.json), contains the parameter configuration you want to deploy your stack with. This is used during the CloudFormation Change Set, as part of the deployment stage.## How to use:
This version of the module expects GitHub as source code repository to be used. You'll need an OAuthToken (``github_token``) that has access to the repo (``github_repo``) you want to read from.
The ``stack_name`` is what you configured as a SAM stack name.
```hcl
data "template_file" "buildspec" {
template = file("${path.module}/codebuild/buildspec.yml")
}module "codepipeline" {
source = "github.com/rpstreef/terraform-aws-codepipeline-sam?ref=v1.1"resource_tag_name = var.resource_tag_name
environment = var.environment
region = var.regiongithub_token = var.github_token
github_owner = var.github_owner
github_repo = var.github_repo
poll_source_changes = var.poll_source_changesbuild_image = "aws/codebuild/standard:4.0"
buildspec = data.template_file.buildspec.renderedstack_name = var.stack_name
environment_variable_map = [
{
name = "REGION"
value = var.region
type = "PLAINTEXT"
},
{
name = "COGNITO_USER_POOL_ID"
value = module.cognito.cognito_user_pool_id
type = "PLAINTEXT"
}
]
}
```## Changelog
### V1.3
- Added ``codepipeline_sam_module_enabled`` on/off module switch### V1.2
- Added Environment variables support for CodeBuild templates.### v1.1
- Separated Buildspec YML file from module. See the ``./codebuild/buildspec.yml`` file for an example.### v1.0
- Initial release