Skip to content

Commit

Permalink
Merge pull request #16 from lgallard/fix/readmes
Browse files Browse the repository at this point in the history
Update READMEs in example folder
  • Loading branch information
lgallard authored Apr 22, 2021
2 parents dcec684 + 3182af9 commit cf767c6
Show file tree
Hide file tree
Showing 4 changed files with 259 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ In the [examples](examples/) folder you can check both approaches in detail and
```
module "myapp-project" {
source = "git::https://github.com/lgallard/terraform-aws-codebuild.git"
source = "lgallard/codebuild/aws"
name = "my-app"
description = "Codebuild for deploying myapp"
Expand Down Expand Up @@ -99,7 +99,7 @@ module "myapp-project" {
```
module "myapp-project" {
source = "git::https://github.com/lgallard/terraform-aws-codebuild.git"
source = "lgallard/codebuild/aws"
name = "my-app-var"
description = "Codebuild for deploying myapp (variables)"
Expand Down
93 changes: 93 additions & 0 deletions examples/codebuild_using_objects/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,95 @@
# terraform-aws-codebuild (objects example)
This example shows how to use this module with objects to build a "Hello World" node.js docker image and push it to an ECR registry

```
# CodeBuild
module "myapp-project" {
source = "lgallard/codebuild/aws"
name = "my-app"
description = "Codebuild for deploying myapp"
# CodeBuild Source
codebuild_source_version = "master"
codebuild_source = {
type = "GITHUB"
location = "https://github.com/lgallard/codebuild-example.git"
git_clone_depth = 1
git_submodules_config = {
fetch_submodules = true
}
}
# Secondary Sources (optional)
codebuild_secondary_sources = [
{
type = "GITHUB"
location = "https://github.com/myprofile/myproject-1.git"
source_identifier = "my_awesome_project1"
},
{
type = "GITHUB"
location = "https://github.com/myprofile/myproject-2.git"
git_clone_depth = 1
source_identifier = "my_awesome_project2"
report_build_status = true
insecure_ssl = true
}
]
# Environment
environment = {
compute_type = "BUILD_GENERAL1_SMALL"
image = "aws/codebuild/standard:2.0"
type = "LINUX_CONTAINER"
privileged_mode = true
# Environment variables
variables = [
{
name = "REGISTRY_URL"
value = "012345678910.dkr.ecr.us-west-1.amazonaws.com/my-ecr"
},
{
name = "AWS_DEFAULT_REGION"
value = "us-west-1"
},
]
}
# Artifacts
artifacts = {
location = aws_s3_bucket.myapp-project.bucket
type = "S3"
path = "/"
packaging = "ZIP"
}
# Cache
cache = {
type = "S3"
location = aws_s3_bucket.myapp-project.bucket
}
# Logs
s3_logs = {
status = "ENABLED"
location = "${aws_s3_bucket.myapp-project.id}/build-log"
}
# Tags
tags = {
Environment = "dev"
owner = "development-team"
}
}
# S3
resource "aws_s3_bucket" "myapp-project" {
bucket_prefix = "myapp-project-bucket-"
acl = "private"
}
```
98 changes: 98 additions & 0 deletions examples/codebuild_using_objects_vpc/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,100 @@
# terraform-aws-codebuild (VPC example)
This example shows how to use this module to build a "Hello World" node.js docker image on a VPC, to push it to an ECR registry

```
# CodeBuild
module "myapp-project-vpc" {
source = "lgallard/codebuild/aws"
name = "my-app-vpc"
description = "Codebuild for deploying myapp in a VPC"
codebuild_source_version = "master"
codebuild_source = {
type = "GITHUB"
location = "https://github.com/lgallard/codebuild-example.git"
git_clone_depth = 1
git_submodules_config = {
fetch_submodules = true
}
}
# Secondary Sources (optional)
codebuild_secondary_sources = [
{
type = "GITHUB"
location = "https://github.com/myprofile/myproject-1.git"
source_identifier = "my_awesome_project1"
},
{
type = "GITHUB"
location = "https://github.com/myprofile/myproject-2.git"
git_clone_depth = 1
source_identifier = "my_awesome_project2"
report_build_status = true
insecure_ssl = true
}
]
environment = {
compute_type = "BUILD_GENERAL1_SMALL"
image = "aws/codebuild/standard:2.0"
type = "LINUX_CONTAINER"
privileged_mode = true
# Environment variables
variables = [
{
name = "REGISTRY_URL"
value = "012345678910.dkr.ecr.us-west-1.amazonaws.com/my-ecr"
},
{
name = "AWS_DEFAULT_REGION"
value = "us-west-1"
},
]
}
artifacts = {
location = aws_s3_bucket.myapp-project.bucket
type = "S3"
path = "/"
packaging = "ZIP"
}
cache = {
type = "S3"
location = aws_s3_bucket.myapp-project.bucket
}
# Logs
s3_logs = {
status = "ENABLED"
location = "${aws_s3_bucket.myapp-project.id}/build-log"
}
# VPC
vpc_config = {
vpc_id = "vpc-123446789101"
subnets = ["subnet-7a1dc5a54444", "subnet-6b4a45b64444"]
security_group_ids = ["sg-b475b46c4444", "sg-58b61a4c4444"]
}
# Tags
tags = {
Environment = "dev"
owner = "development-team"
}
}
# S3
resource "aws_s3_bucket" "myapp-project" {
bucket = "myapp-project-bucket"
acl = "private"
}
```
67 changes: 66 additions & 1 deletion examples/codebuild_using_variables/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,67 @@
# terraform-aws-codebuild (variables example)
This example shows how to use this module with variables build a "Hello World" node.js docker image and push it to an ECR registry
This example shows how to use this module with variables build a "Hello World" node.js docker image and push it to an ECR registry.

```
# CodeBuild
module "myapp-project-var" {
source = "lgallard/codebuild/aws"
name = "my-app-var"
description = "Codebuild for deploying myapp (variables)"
# CodeBuild Source
codebuild_source_version = "master"
codebuild_source_type = "GITHUB"
codebuild_source_location = "https://github.com/lgallard/codebuild-example.git"
codebuild_source_git_clone_depth = 1
codebuild_source_git_submodules_config_fetch_submodules = true
# Environment
environment_compute_type = "BUILD_GENERAL1_SMALL"
environment_image = "aws/codebuild/standard:2.0"
environment_type = "LINUX_CONTAINER"
environment_privileged_mode = true
# Environment variables
environment_variables = [
{
name = "REGISTRY_URL"
value = "012345678910.dkr.ecr.us-west-1.amazonaws.com/my-ecr"
},
{
name = "AWS_DEFAULT_REGION"
value = "us-west-1"
},
]
# Artifacts
artifacts_location = aws_s3_bucket.myapp-project.bucket
artifacts_type = "S3"
artifacts_path = "/"
artifacts_packaging = "ZIP"
# Cache
cache_type = "S3"
cache_location = aws_s3_bucket.myapp-project.bucket
# Logs
s3_logs_status = "ENABLED"
s3_logs_location = "${aws_s3_bucket.myapp-project.id}/build-var-log"
# Tags
tags = {
Environment = "dev"
owner = "development-team"
}
}
# S3
resource "aws_s3_bucket" "myapp-project" {
bucket = "myapp-project-bucket"
acl = "private"
}
```

0 comments on commit cf767c6

Please sign in to comment.