0% found this document useful (0 votes)
72 views8 pages

Tmknom - Terraform-Aws-Codebuild - Terraform Module Which Creates CodeBuild Resources On AWS

This Terraform module creates AWS CodeBuild resources, including CodeBuild projects and a CodeBuild service role. It provides recommended settings to support CodePipeline and allows specifying configuration parameters like the compute type, build spec, cache settings, and IAM permissions. The module is open source and available on GitHub.

Uploaded by

futuregm2400
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
72 views8 pages

Tmknom - Terraform-Aws-Codebuild - Terraform Module Which Creates CodeBuild Resources On AWS

This Terraform module creates AWS CodeBuild resources, including CodeBuild projects and a CodeBuild service role. It provides recommended settings to support CodePipeline and allows specifying configuration parameters like the compute type, build spec, cache settings, and IAM permissions. The module is open source and available on GitHub.

Uploaded by

futuregm2400
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

4/13/22, 12:03 PM tmknom/terraform-aws-codebuild: Terraform module which creates CodeBuild resources on AWS.

tmknom / terraform-aws-codebuild Public

Terraform module which creates CodeBuild resources on AWS.


Apache-2.0 License


5
stars

9
forks


Star
Watch

Code Issues Pull requests Actions Projects Wiki Security


master

tmknom
Merge pull request #20 from tmknom/add-config-for-githu… … on May 3, 2020
66

View code

README.md

terraform-aws-codebuild
Terraform passing
Markdown passing
YAML passing
JSON passing
tag v1.2.0

license Apache-2.0

Terraform module which creates CodeBuild resources on AWS.

Description
Provision CodeBuild_Projects and
CodeBuild Service Role.

This module provides recommended settings:

Support CodePipeline

Usage

Minimal

https://github.com/tmknom/terraform-aws-codebuild 1/8
4/13/22, 12:03 PM tmknom/terraform-aws-codebuild: Terraform module which creates CodeBuild resources on AWS.

module "codebuild" {

source = "git::https://github.com/tmknom/terraform-aws-codebuild.git?ref=tags/2.0.
name = "example"

Complete

module "codebuild" {

source = "git::https://github.com/tmknom/terraform-aws-codebuild.git?ref=tags/2.0.
name = "example"

artifact_bucket_arn = var.artifact_bucket_arn

environment_type = "LINUX_CONTAINER"

compute_type = "BUILD_GENERAL1_MEDIUM"

image = "aws/codebuild/docker:18.09.0"

privileged_mode = true

buildsp
buildspec = "configuration/buildspec.yml
buildsp "

cache_type = "S3"

cache_location = "${aws_s3_bucket.artifact.id}/codebuild"

encryption_key = ""

build_timeout = 10

iam_path = "/service-role/"

description = "This is example"

enabled_ecr_access = true

ecr_access_policy_arn = "arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryPowerUs

tags = {

Environment = "prod"

Examples
Minimal
Complete

Requirements
https://github.com/tmknom/terraform-aws-codebuild 2/8
4/13/22, 12:03 PM tmknom/terraform-aws-codebuild: Terraform module which creates CodeBuild resources on AWS.

Name Version

terraform >= 0.12

Providers

Name Version

aws n/a

Inputs

Name Description Type D

The projects
name string n/a
name.

The S3
artifact_bucket_arn Bucket ARN string "arn:aws:s3:::*"
of artifacts.

How long in
minutes to
wait until
timing out
build_timeout any related string 60
build that
does not get
marked as
completed.

The build
spec
declaration
to use for
buildsp
buildspec string ""
this build
project's
related
builds.

https://github.com/tmknom/terraform-aws-codebuild 3/8
4/13/22, 12:03 PM tmknom/terraform-aws-codebuild: Terraform module which creates CodeBuild resources on AWS.

Name Description Type D

The location
where the
AWS
CodeBuild
cache_location string ""
project
stores
cached
resources.

The type of
storage that
will be used
cache_type for the AWS string "NO_CACHE"
CodeBuild
project
cache.

Information
about the
compute
compute_type resources string "BUILD_GENERAL1_SMALL"
the build
project will
use.

The
description
description string "Managed by Terraform"
of the all
resources.

The ARN
specifying
ecr_access_policy_arn the IAM string "arn:aws:iam::aws:policy/Ama
Role for ECR
access.

If set to true,
enables
enabled_ecr_access bool true
access to
ECR.

https://github.com/tmknom/terraform-aws-codebuild 4/8
4/13/22, 12:03 PM tmknom/terraform-aws-codebuild: Terraform module which creates CodeBuild resources on AWS.

Name Description Type D

The KMS
CMK to be
used for
encrypting
encryption_key string ""
the build
project's
build output
artifacts.

The type of
build
environment
environment_type string "LINUX_CONTAINER"
to use for
related
builds.

Path in
which to
create the
iam_path string "/"
IAM Role
and the IAM
Policy.

The image
identifier of
the Docker
image image to string "aws/codebuild/ubuntu-base:1
use for this
build
project.

If set to true,
enables
running the
Docker
privileged_mode bool true
daemon
inside a
Docker
container.

https://github.com/tmknom/terraform-aws-codebuild 5/8
4/13/22, 12:03 PM tmknom/terraform-aws-codebuild: Terraform module which creates CodeBuild resources on AWS.

Name Description Type D

A mapping
of tags to
tags map(string) {}
assign to all
resources.

Outputs

Name Description

codebuild_project_arn The ARN of the CodeBuild project.

The name (if imported via name) or ARN (if created via
codebuild_project_id
Terraform or imported via ARN) of the CodeBuild project.

iam_policy_arn The ARN assigned by AWS to this IAM Policy.

iam_policy_description The description of the IAM Policy.

iam_policy_document The policy document of the IAM Policy.

iam_policy_id The IAM Policy's ID.

iam_policy_name The name of the IAM Policy.

iam_policy_path The path of the IAM Policy.

iam_role_arn The Amazon Resource Name (ARN) specifying the IAM Role.

iam_role_create_date The creation date of the IAM Role.

iam_role_description The description of the IAM Role.

iam_role_name The name of the IAM Role.

iam_role_unique_id The stable and unique string identifying the IAM Role.

Development

Development Requirements
Docker
https://github.com/tmknom/terraform-aws-codebuild 6/8
4/13/22, 12:03 PM tmknom/terraform-aws-codebuild: Terraform module which creates CodeBuild resources on AWS.

Configure environment variables

export AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE

export AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

export AWS_DEFAULT_REGION=ap-northeast-1

Installation

git clone [email protected]:tmknom/terraform-aws-codebuild.git

cd terraform-aws-codebuild

make install

Makefile targets

apply-complete Run terraform apply examples/complete

apply-minimal Run terraform apply examples/minimal

bump-version Bump version (Required argument 'VERSION')

check-format Check format code

clean Clean .terraform

destroy-complete Run terraform destroy examples/complete

destroy-minimal Run terraform destroy examples/minimal

diff Word diff

docs Generate docs


format Format code

help Show help

install Install requirements

lint Lint code

plan-complete Run terraform plan examples/complete

plan-minimal Run terraform plan examples/minimal

release Release GitHub and Terraform Module Registry

upgrade Upgrade makefile

Releasing new versions


Bump VERSION file, and run make release .

Terraform Module Registry


https://registry.terraform.io/modules/tmknom/codebuild/aws

License
https://github.com/tmknom/terraform-aws-codebuild 7/8
4/13/22, 12:03 PM tmknom/terraform-aws-codebuild: Terraform module which creates CodeBuild resources on AWS.

Apache 2 Licensed. See LICENSE for full details.

Releases


3
tags

Packages

No packages published

Languages

HCL 91.3%
Makefile 8.7%

https://github.com/tmknom/terraform-aws-codebuild 8/8

You might also like