Terraform modules that are related to codedeploy
Create a codedeploy app
- [
name
]: String(required): Name of your codedeploy application - [
project
]: String(required): The current project - [
s3_bucket_arn
]: String(optional): ARN of the S3 bucket where to fetch the application revision packages
- [
app_name
]: String: Name of the codedeploy app - [
deployer_policy_id
]: String: IAM policy id for the user / role that will upload application revisions and trigger deployments - [
deployer_policy_arn
]: String: IAM policy ARN for the user / role that will upload application revisions and trigger deployments - [
deployer_policy_name
]: String: IAM policy name for the user / role that will upload application revisions and trigger deployments
module "codedeploy" {
source = "github.com/skyscrapers/terraform-codedeploy//app"
name = "application"
project = "example"
}
Create an deployment group for a codedeploy app
- [
environment
]: String(required): Environment where your codedeploy deployment group is used for - [
app_name
]: String(required): Name of the coddeploy app - [
service_role_arn
]: String(required): IAM role that is used by the deployment group. You can use the terraform-iam module for this. - [
autoscaling_groups
]: List(required): Autoscaling groups you want to attach to the deployment group - [
rollback_enbled
]: Bool(optional, default:false
): Whether to enable auto rollback - [
rollback_events
]: List(optional, default:["DEPLOYMENT_FAILURE"]
): The event types that trigger a rollback
/
module "deployment_group" {
source = "github.com/skyscrapers/terraform-codedeploy//deployment-group"
environment = "production"
app_name = "${module.codedeploy.app_name}"
service_role_arn = "${module.iam.arn_role}"
autoscaling_groups = ["autoscaling1", "autoscaling2"]
}
Create an deployment group for a codedeploy app
- [
environment
]: String(required): Environment where your codedeploy deployment group is used for - [
app_name
]: String(required): Name of the coddeploy app - [
service_role_arn
]: String(required): IAM role that is used by the deployment group. You can use the terraform-iam module for this. - [
autoscaling_groups
]: List(required): Autoscaling groups you want to attach to the deployment group - [
rollback_enbled
]: Bool(optional, default:false
): Whether to enable auto rollback - [
rollback_events
]: List(optional, default:["DEPLOYMENT_FAILURE"]
): The event types that trigger a rollback - [
trigger_target_arn
]: String(required): SNS topic through which notifications are sent.
/
module "deployment_group" {
source = "github.com/skyscrapers/terraform-codedeploy//deployment-group"
environment = "production"
app_name = "${module.codedeploy.app_name}"
service_role_arn = "${module.iam.arn_role}"
autoscaling_groups = ["autoscaling1", "autoscaling2"]
trigger_target_arn = "arn:aws:sns:eu-west-1:123456780:CodeDeploy"
}
Create an deployment group for a codedeploy app. This module will filter for tags
- [
environment
]: String(required): Environment where your codedeploy deployment group is used for - [
app_name
]: String(required): Name of the coddeploy app - [
service_role_arn
]: String(required): IAM role that is used by the deployment group. You can use the terraform-iam module for this. - [
rollback_enbled
]: Bool(optional, default:false
): Whether to enable auto rollback - [
rollback_events
]: List(optional, default:["DEPLOYMENT_FAILURE"]
): The event types that trigger a rollback - [
filterkey
]: String(required): The key of the tag you assigned to the instances belonging to this deployment group - [
filtervalue
]: String(required): The value of the tag you assigned to the instances belonging to this deployment group
/
module "deployment_group-ec2tag" {
source = "github.com/skyscrapers/terraform-codedeploy//deployment-group-ec2tag"
environment = "production"
app_name = "${module.codedeploy.app_name}"
service_role_arn = "${module.iam.arn_role}"
filterkey = "app"
filtervalue = "web"
}
Create an deployment group for a codedeploy app and will set the notifications. This module will filter for tags
- [
environment
]: String(required): Environment where your codedeploy deployment group is used for - [
app_name
]: String(required): Name of the coddeploy app - [
service_role_arn
]: String(required): IAM role that is used by the deployment group. You can use the terraform-iam module for this. - [
rollback_enbled
]: Bool(optional, default:false
): Whether to enable auto rollback - [
rollback_events
]: List(optional, default:["DEPLOYMENT_FAILURE"]
): The event types that trigger a rollback - [
filterkey
]: String(required): The key of the tag you assigned to the instances belonging to this deployment group - [
filtervalue
]: String(required): The value of the tag you assigned to the instances belonging to this deployment group - [
trigger_arn
]: String(required): SNS topic through which notifications are sent. - [
trigger_name
]: String(required): the name of the notification trigger. - [
trigger_events
]: String(optional): events that can trigger the notifications.
/
module "deployment_group-ec2tag-notify" {
source = "github.com/skyscrapers/terraform-codedeploy//deployment-group-ec2tag-triggered"
environment = "production"
app_name = "${module.codedeploy.app_name}"
service_role_arn = "${module.iam.arn_role}"
filterkey = "app"
filtervalue = "web"
trigger_name = "SNSToSlack"
trigger_arn = "arn:aws:sns:eu-west-1:123456780:CodeDeploy"
}
Create an S3 bucket to use with Codedeploy, to store application revisions.
See s3bucket/variables.tf for available variables.
- [
bucket_id
]: String: S3 bucket id - [
bucket_arn
]: String: S3 bucket ARN - [
policy_id
]: String: IAM policy id for the EC2 instances working with Codedeploy - [
policy_arn
]: String: IAM policy ARN for the EC2 instances working with Codedeploy - [
policy_name
]: String: IAM policy name for the EC2 instances working with Codedeploy
module "codedeploy_bucket" {
source = "github.com/skyscrapers/terraform-codedeploy//s3bucket?ref=478373f6f8d4a46b7a1ec96090707365e0ae3e42"
name_prefix = "halito"
}
Creates a lambda function that notifies Slack via the incoming webhooks when a deployment event happens using an SNS topic to call the lambda function.
- [
slack_webhook_url
]: String: the encrypted url to send our notifications to - [
slack_channel
]: String: The channel where we want to publish the notification - [
kms_key_arn
]: String: kms key used to encrypt the webhook
- [
sns_topic
]: String: The SNS topic to configure for the codedeploy deployment groups
module "slack-notification" {
source = "github.com/skyscrapers/terraform-codedeploy//notify-slack"
slack_webhook_url = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
slack_channel = "#channel_name"
kms_key_arn = "${aws_kms_key.kms_key.arn}"
}