Skip to content

Commit 5dbd24a

Browse files
authored
Usage examples. Update README (#13)
* Update `LICENSE` * Update examples * Add `new_vpc_new_subnets` example * Add `existing_vpc_new_subnets` example * Add `existing_vpc_existing_subnets` example * Bump module versions * Update `README` * Update `README` * Update `README`
1 parent ac47347 commit 5dbd24a

File tree

7 files changed

+424
-123
lines changed

7 files changed

+424
-123
lines changed

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2017 Cloud Posse, LLC
189+
Copyright 2017-2018 Cloud Posse, LLC
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.md

+240-89
Large diffs are not rendered by default.

examples/complete/.gitignore

-6
This file was deleted.

examples/complete/main.tf renamed to examples/existing_vpc_existing_subnets/main.tf

+7-24
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,20 @@ module "jenkins" {
1111
stage = "prod"
1212
description = "Jenkins server as Docker container running on Elastic Beanstalk"
1313

14+
master_instance_type = "t2.medium"
1415
aws_account_id = "000111222333"
1516
aws_region = "us-west-2"
1617
availability_zones = ["${data.aws_availability_zones.available.names}"]
1718
solution_stack_name = "64bit Amazon Linux 2017.03 v2.7.4 running Docker 17.03.2-ce"
18-
vpc_id = "vpc-00112233"
19+
vpc_id = "vpc-a22222ee"
1920
zone_id = "ZXXXXXXXXXXX"
20-
public_subnets = "${module.vpc.public_subnet_ids}"
21-
private_subnets = "${module.vpc.private_subnet_ids}"
21+
public_subnets = ["subnet-e63f82cb", "subnet-e66f44ab", "subnet-e88f42bd"]
22+
private_subnets = ["subnet-e99d23eb", "subnet-e77e12bb", "subnet-e58a52bc"]
2223
loadbalancer_type = "application"
2324
loadbalancer_certificate_arn = "XXXXXXXXXXXXXXXXX"
24-
ssh_key_pair = "key-test-1"
25+
ssh_key_pair = "ssh-key-jenkins"
2526

26-
github_oauth_token = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
27+
github_oauth_token = ""
2728
github_organization = "cloudposse"
2829
github_repo_name = "jenkins"
2930
github_branch = "master"
@@ -33,7 +34,7 @@ module "jenkins" {
3334
image_tag = "latest"
3435

3536
datapipeline_config = {
36-
instance_type = "t2.micro"
37+
instance_type = "t2.medium"
3738
3839
period = "12 hours"
3940
timeout = "60 Minutes"
@@ -53,21 +54,3 @@ module "jenkins" {
5354
Department = "XYZ"
5455
}
5556
}
56-
57-
# Terraform module to create a VPC with public and private subnets
58-
module "vpc" {
59-
source = "git::https://github.com/cloudposse/terraform-aws-vpc.git?ref=master"
60-
availability_zones = "${data.aws_availability_zones.available.names}"
61-
namespace = "cp"
62-
name = "jenkins"
63-
stage = "prod"
64-
region = "us-west-2"
65-
cidr_block = "10.0.0.0/16"
66-
delimiter = "-"
67-
attributes = ["vpc"]
68-
69-
tags = {
70-
BusinessUnit = "ABC"
71-
Department = "XYZ"
72-
}
73-
}
+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
provider "aws" {
2+
region = "us-west-2"
3+
}
4+
5+
data "aws_availability_zones" "available" {}
6+
7+
module "jenkins" {
8+
source = "../../"
9+
namespace = "cp"
10+
name = "jenkins"
11+
stage = "prod"
12+
description = "Jenkins server as Docker container running on Elastic Beanstalk"
13+
14+
master_instance_type = "t2.medium"
15+
aws_account_id = "000111222333"
16+
aws_region = "us-west-2"
17+
availability_zones = ["${data.aws_availability_zones.available.names}"]
18+
solution_stack_name = "64bit Amazon Linux 2017.03 v2.7.4 running Docker 17.03.2-ce"
19+
vpc_id = "vpc-a22222ee"
20+
zone_id = "ZXXXXXXXXXXX"
21+
public_subnets = "${module.subnets.public_subnet_ids}"
22+
private_subnets = "${module.subnets.private_subnet_ids}"
23+
loadbalancer_type = "application"
24+
loadbalancer_certificate_arn = "XXXXXXXXXXXXXXXXX"
25+
ssh_key_pair = "ssh-key-jenkins"
26+
27+
github_oauth_token = ""
28+
github_organization = "cloudposse"
29+
github_repo_name = "jenkins"
30+
github_branch = "master"
31+
32+
build_image = "aws/codebuild/docker:1.12.1"
33+
build_compute_type = "BUILD_GENERAL1_SMALL"
34+
image_tag = "latest"
35+
36+
datapipeline_config = {
37+
instance_type = "t2.medium"
38+
39+
period = "12 hours"
40+
timeout = "60 Minutes"
41+
}
42+
43+
env_vars = {
44+
JENKINS_USER = "admin"
45+
JENKINS_PASS = "123456"
46+
JENKINS_NUM_EXECUTORS = 4
47+
}
48+
49+
delimiter = "-"
50+
attributes = []
51+
52+
tags = {
53+
BusinessUnit = "ABC"
54+
Department = "XYZ"
55+
}
56+
}
57+
58+
module "subnets" {
59+
source = "git::https://github.com/cloudposse/terraform-aws-dynamic-subnets.git?ref=master"
60+
availability_zones = ["${data.aws_availability_zones.available.names}"]
61+
namespace = "cp"
62+
name = "jenkins"
63+
stage = "prod"
64+
region = "us-west-2"
65+
vpc_id = "vpc-a22222ee"
66+
igw_id = "igw-s32321vd"
67+
cidr_block = "10.0.0.0/16"
68+
nat_gateway_enabled = "true"
69+
vpc_default_route_table_id = "ZXXXXXXXXXXX"
70+
public_network_acl_id = "ZXXXXXXXXXXX"
71+
private_network_acl_id = "ZXXXXXXXXXXX"
72+
delimiter = "-"
73+
attributes = ["subnet"]
74+
75+
tags = {
76+
BusinessUnit = "ABC"
77+
Department = "XYZ"
78+
}
79+
}

examples/new_vpc_new_subnets/main.tf

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
provider "aws" {
2+
region = "us-west-2"
3+
}
4+
5+
data "aws_availability_zones" "available" {}
6+
7+
module "jenkins" {
8+
source = "../../"
9+
namespace = "cp"
10+
name = "jenkins"
11+
stage = "prod"
12+
description = "Jenkins server as Docker container running on Elastic Beanstalk"
13+
14+
master_instance_type = "t2.medium"
15+
aws_account_id = "000111222333"
16+
aws_region = "us-west-2"
17+
availability_zones = ["${data.aws_availability_zones.available.names}"]
18+
solution_stack_name = "64bit Amazon Linux 2017.03 v2.7.4 running Docker 17.03.2-ce"
19+
vpc_id = "${module.vpc.vpc_id}"
20+
zone_id = "ZXXXXXXXXXXX"
21+
public_subnets = "${module.subnets.public_subnet_ids}"
22+
private_subnets = "${module.subnets.private_subnet_ids}"
23+
loadbalancer_type = "application"
24+
loadbalancer_certificate_arn = "XXXXXXXXXXXXXXXXX"
25+
ssh_key_pair = "ssh-key-jenkins"
26+
27+
github_oauth_token = ""
28+
github_organization = "cloudposse"
29+
github_repo_name = "jenkins"
30+
github_branch = "master"
31+
32+
build_image = "aws/codebuild/docker:1.12.1"
33+
build_compute_type = "BUILD_GENERAL1_SMALL"
34+
image_tag = "latest"
35+
36+
datapipeline_config = {
37+
instance_type = "t2.medium"
38+
39+
period = "12 hours"
40+
timeout = "60 Minutes"
41+
}
42+
43+
env_vars = {
44+
JENKINS_USER = "admin"
45+
JENKINS_PASS = "123456"
46+
JENKINS_NUM_EXECUTORS = 4
47+
}
48+
49+
delimiter = "-"
50+
attributes = []
51+
52+
tags = {
53+
BusinessUnit = "ABC"
54+
Department = "XYZ"
55+
}
56+
}
57+
58+
module "vpc" {
59+
source = "git::https://github.com/cloudposse/terraform-aws-vpc.git?ref=master"
60+
namespace = "cp"
61+
name = "jenkins"
62+
stage = "prod"
63+
cidr_block = "10.0.0.0/16"
64+
delimiter = "-"
65+
attributes = ["vpc"]
66+
67+
tags = {
68+
BusinessUnit = "ABC"
69+
Department = "XYZ"
70+
}
71+
}
72+
73+
module "subnets" {
74+
source = "git::https://github.com/cloudposse/terraform-aws-dynamic-subnets.git?ref=master"
75+
availability_zones = ["${data.aws_availability_zones.available.names}"]
76+
namespace = "cp"
77+
name = "jenkins"
78+
stage = "prod"
79+
region = "us-west-2"
80+
vpc_id = "${module.vpc.vpc_id}"
81+
igw_id = "${module.vpc.igw_id}"
82+
cidr_block = "10.0.0.0/16"
83+
nat_gateway_enabled = "true"
84+
vpc_default_route_table_id = "${module.vpc.vpc_default_route_table_id}"
85+
public_network_acl_id = "${module.vpc.vpc_default_network_acl_id}"
86+
private_network_acl_id = "${module.vpc.vpc_default_network_acl_id}"
87+
delimiter = "-"
88+
attributes = ["subnet"]
89+
90+
tags = {
91+
BusinessUnit = "ABC"
92+
Department = "XYZ"
93+
}
94+
}

main.tf

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module "elastic_beanstalk_application" {
1212

1313
# Elastic Beanstalk Environment
1414
module "elastic_beanstalk_environment" {
15-
source = "git::https://github.com/cloudposse/terraform-aws-elastic-beanstalk-environment.git?ref=tags/0.2.8"
15+
source = "git::https://github.com/cloudposse/terraform-aws-elastic-beanstalk-environment.git?ref=tags/0.3.1"
1616
namespace = "${var.namespace}"
1717
name = "${var.name}"
1818
stage = "${var.stage}"
@@ -113,7 +113,7 @@ module "efs_backup" {
113113

114114
# CodePipeline/CodeBuild to build Jenkins Docker image, store it to a ECR repo, and deploy it to Elastic Beanstalk running Docker stack
115115
module "cicd" {
116-
source = "git::https://github.com/cloudposse/terraform-aws-cicd.git?ref=tags/0.4.6"
116+
source = "git::https://github.com/cloudposse/terraform-aws-cicd.git?ref=tags/0.5.0"
117117
namespace = "${var.namespace}"
118118
name = "${var.name}"
119119
stage = "${var.stage}"
@@ -139,7 +139,7 @@ module "cicd" {
139139

140140
# Label for EC2 slaves
141141
module "label_slaves" {
142-
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.2.2"
142+
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.3.1"
143143
namespace = "${var.namespace}"
144144
name = "${var.name}"
145145
stage = "${var.stage}"

0 commit comments

Comments
 (0)