Skip to content

HappyPathway/terraform-aws-image-pipeline

Repository files navigation

Terraform Validation

Requirements

Name Version
terraform >= 1.0.0
aws >= 4.20.1

Providers

Name Version
aws 5.86.0
random 3.6.3
tls 4.0.6

Modules

Name Source Version
build_user ./modules/build_user n/a
codebuild_terraform ./modules/codebuild n/a
codepipeline_iam_role ./modules/iam-role n/a
codepipeline_kms ./modules/kms n/a
codepipeline_terraform ./modules/codepipeline n/a
s3_artifacts_bucket ./modules/s3 n/a

Resources

Name Type
aws_key_pair.deployer resource
aws_secretsmanager_secret.secrets resource
aws_secretsmanager_secret.ssh_key resource
aws_secretsmanager_secret_version.secrets resource
aws_secretsmanager_secret_version.ssh_key resource
aws_security_group.packer resource
aws_security_group_rule.sg_rule resource
aws_ssm_parameter.managed_parameters resource
aws_vpc_security_group_egress_rule.allow_all_traffic_ipv4 resource
aws_vpc_security_group_egress_rule.allow_all_traffic_ipv6 resource
aws_vpc_security_group_ingress_rule.allow_all_ssh_ipv4 resource
random_pet.keyname resource
tls_private_key.ssh resource
aws_caller_identity.current data source
aws_iam_policy_document.build_user_default data source
aws_partition.current data source
aws_region.current data source

Inputs

Name Description Type Default Required
ami n/a
object({
instance_type = string
source_ami = string
})
null no
ansible_bucket Ansible bucket details
object({
name = string,
key = string
})
null no
ansible_repo Source of Ansible Repo
object({
arn = optional(string)
repository_name = optional(string, "image-pipeline-ansible-playbooks")
branch = optional(string, "main")
})
null no
ansible_source_type Type of source to be used for the Ansible CodePipeline string "CodeCommit" no
assets_bucket_name Name of the S3 bucket used to store the deployment artifacts string "image-pipeline-assets" no
build_environment_variables n/a
list(object({
name = string
value = string
type = optional(string, "PLAINTEXT")
}))
null no
build_project_source Source Code Repo for Playbook string "CODEPIPELINE" no
build_projects List of Names of the CodeBuild projects to be created
list(object({
name = string,
vars = optional(map(string), {})
environment_variables = optional(list(object({
name = string
value = string
type = string
})), [])
buildspec = optional(string)
}))
[
{
"name": "build"
},
{
"name": "test"
}
]
no
build_user_iam_policy The IAM policy for the build user. string null no
builder_compute_type Relative path to the Apply and Destroy build spec file string "BUILD_GENERAL1_SMALL" no
builder_image Docker Image to be used by codebuild string "aws/codebuild/amazonlinux2-x86_64-standard:3.0" no
builder_image_pull_credentials_type Image pull credentials type used by codebuild project string "CODEBUILD" no
builder_images n/a map(string) {} no
builder_type Type of codebuild run environment string "LINUX_CONTAINER" no
codepipeline_iam_role_name Name of the IAM role to be used by the Codepipeline string "codepipeline-role" no
create_new_role Whether to create a new IAM Role. Values are true or false. Defaulted to true always. bool true no
docker_build n/a bool false no
extra_parameters n/a map(string) {} no
goss_binary GOSS Profile to be used for testing string "goss-linux-amd64" no
goss_bucket Goss bucket details
object({
name = string,
key = string
})
null no
goss_profile GOSS Profile to be used for testing string "goss" no
goss_repo Source of Goss Repo
object({
arn = optional(string)
repository_name = optional(string, "image-pipeline-goss-testing")
branch = optional(string, "main")
})
null no
goss_source_type Type of source to be used for the Goss CodePipeline string "CodeCommit" no
image n/a
object({
dest_tag = string
dest_docker_repo = string
source_image = string
source_tag = string
source_docker_repo = string
})
null no
image_volume_mapping n/a
list(object({
device_name = string
volume_size = number
volume_type = string
delete_on_termination = bool
encrypted = optional(bool, false)
iops = optional(number, null)
snapshot_id = optional(string, null)
throughput = optional(number, null)
virtual_name = optional(string, null)
kms_key_id = optional(string, null)
mount_path = optional(string, null)
}))
[] no
kms_key_id n/a string null no
nonmanaged_parameters n/a list(string)
[
"dest_tag"
]
no
packer_bucket Source bucket details
object({
name = string,
key = string
})
null no
packer_config Name of Packer Config in Repo string "build.pkr.hcl" no
packer_repo Source of the Terraform Repo
object({
arn = optional(string)
repository_name = optional(string, "linux-image-pipeline")
branch = optional(string, "main")
})
null no
packer_source_type Type of source to be used for the CodePipeline string "CodeCommit" no
packer_version Terraform CLI Version string "1.10.3" no
parameter_arns n/a list(string) null no
playbook n/a string null no
project_name Unique name for this project string n/a yes
required_packages n/a
list(object({
src = string
dest = string
}))
[] no
secret_arns n/a list(string) null no
secrets n/a map(string) {} no
shared_accounts n/a list(string) null no
shared_kms_key_arns n/a list(string) [] no
ssh_user SSH username string null no
stage_input Tags to be attached to the CodePipeline
list(object({
name = string,
category = string,
owner = string,
provider = string,
input_artifacts = list(string),
output_artifacts = list(string)
}))
[
{
"category": "Build",
"input_artifacts": [
"SourceOutput",
"SourceAnsibleOutput"
],
"name": "build",
"output_artifacts": [
"BuildOutput"
],
"owner": "AWS",
"provider": "CodeBuild"
},
{
"category": "Build",
"input_artifacts": [
"SourceOutput",
"SourceGossOutput"
],
"name": "test",
"output_artifacts": [
"BuildTestOutput"
],
"owner": "AWS",
"provider": "CodeBuild"
}
]
no
state n/a
object({
bucket = string
key = string
region = string
dynamodb_table = string
})
n/a yes
terraform_version n/a string "1.3.10" no
test_project_source Source Code Repo for Goss Testing Suite string "CODEPIPELINE" no
troubleshoot n/a bool false no
userdata n/a string null no
vpc_config n/a
object({
security_group_ids = list(string)
subnets = list(string)
vpc_id = string
region = string
})
null no
winrm_credentials n/a
object({
username = string
password = string
})
null no

Outputs

Name Description
codepipeline_arn The ARN of the CodePipeline
codepipeline_name The Name of the CodePipeline
iam_arn The ARN of the IAM Role used by the CodePipeline
kms_arn The ARN of the KMS key used in the codepipeline
managed_parameters n/a
s3_arn The ARN of the S3 Bucket
s3_bucket The Name of the S3 Bucket
sec_group n/a
secrets n/a
user n/a