Introduction

Creates a simple 2 stage blue-green CI/CD pipeline for AWS EC2 compute platform.

The Pipeline created consists of 2 stages:

  • Source: Github
  • Deploy: CodeDeploy

Requirements

Name Version
terraform ~> 1.5.0
aws ~> 5.7.0

Providers

Name Version
aws ~> 5.7.0

Modules

No modules.

Resources

Name Type
aws_acm_certificate.this resource
aws_acm_certificate_validation.this resource
aws_alb.this resource
aws_alb_listener.http resource
aws_alb_listener.https resource
aws_alb_listener_rule.this resource
aws_autoscaling_attachment.this resource
aws_autoscaling_group.this resource
aws_autoscaling_policy.this resource
aws_codedeploy_app.this resource
aws_codedeploy_deployment_group.this resource
aws_codepipeline.this resource
aws_codestarconnections_connection.this resource
aws_iam_policy.codepipeline_permissions resource
aws_iam_role.codepipeline_service_role resource
aws_iam_role_policy_attachment.codepipeline_permissions resource
aws_kms_key.codepipeline resource
aws_launch_template.this resource
aws_lb_target_group.this resource
aws_route53_record.alias resource
aws_route53_record.cname resource
aws_s3_bucket.alb_log resource
aws_s3_bucket.codepipeline resource
aws_s3_bucket_policy.alb_log resource
aws_s3_bucket_policy.codepipeline resource
aws_s3_bucket_server_side_encryption_configuration.codepipeline resource
aws_s3_bucket_versioning.codepipeline resource
aws_security_group.alb resource
aws_security_group.webservers resource
aws_iam_policy_document.alb_log data source
aws_iam_policy_document.codepipeline_bucket data source
aws_iam_policy_document.codepipeline_kms_key data source
aws_iam_policy_document.codepipeline_permissions data source
aws_iam_policy_document.codepipeline_trust_policy data source

Inputs

Name Description Type Default Required
account_arn arn of account where all resources are created any n/a yes
ami_id ami used to launch instances string n/a yes
app_name name of application string n/a yes
cicd_hosted_zone_id id of hosted zone where cicd project will be launched string n/a yes
code_deploy_service_role_arn arn of service role associated with code deploy string n/a yes
create_api_id appends random numbers to domain attached to alb; results in api_id.subdomain.com bool n/a yes
desired_number_of_instances maximum number of in ASG must have number n/a yes
domain_name domain to be attached to alb; ssl cert will be issued any n/a yes
instance_profile_arn arn of instance profile associated with EC2 instances string n/a yes
instance_size size of instance to launch string n/a yes
key_administrators arn of iam users allowed to perform admin (rotate/delete/etc) actions on key list(string) n/a yes
key_owner_arn arn of account where kms key is created string n/a yes
key_owner_id id of account where kms key is created string n/a yes
max_number_of_instances max number of instances to scale down to number n/a yes
min_number_of_instances minimum number of instances to scale down to number n/a yes
project_tags tags applied to all resources map(any) {} no
public_subnet_ids public subnet ids (used for alb and autoscaling group) list(string) n/a yes
region aws region any n/a yes
repository the owner and name of the repository where source changes are to be detected. Example: UserName/RepoName, OrgName/RepoName string n/a yes
vpc_id id of vpc where all resources are created any n/a yes

Outputs

Name Description
acm_cert_all n/a
acm_cert_arn n/a
acm_cert_domain_name n/a
alb_log_bucket_arn n/a
alb_log_bucket_id n/a