Skip to content

Commit 89e992f

Browse files
committed
Initial update to 3rd edition code
1 parent f31b91c commit 89e992f

File tree

379 files changed

+6699
-1180
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

379 files changed

+6699
-1180
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
- ec2:
22
count: 10
3-
image: ami-0c55b159cbfafe1f0
3+
image: ami-0fb653ca2d3203ac1
44
instance_type: t2.micro
55

66
- ec2:
77
count: 5
8-
image: ami-0c55b159cbfafe1f0
8+
image: ami-0fb653ca2d3203ac1
99
instance_type: t2.micro
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
{
2+
"Version": "2012-10-17",
3+
"Statement": [
4+
{
5+
"Effect": "Allow",
6+
"Action": "ec2:*",
7+
"Resource": "*"
8+
},
9+
{
10+
"Effect": "Allow",
11+
"Action": "elasticloadbalancing:*",
12+
"Resource": "*"
13+
},
14+
{
15+
"Effect": "Allow",
16+
"Action": "cloudwatch:*",
17+
"Resource": "*"
18+
},
19+
{
20+
"Effect": "Allow",
21+
"Action": "autoscaling:*",
22+
"Resource": "*"
23+
},
24+
{
25+
"Effect": "Allow",
26+
"Action": "iam:*",
27+
"Resource": "*"
28+
},
29+
{
30+
"Effect": "Allow",
31+
"Action": "s3:*",
32+
"Resource": "*"
33+
},
34+
{
35+
"Effect": "Allow",
36+
"Action": "dynamodb:*",
37+
"Resource": "*"
38+
},
39+
{
40+
"Effect": "Allow",
41+
"Action": "kms:*",
42+
"Resource": "*"
43+
},
44+
{
45+
"Effect": "Allow",
46+
"Action": "lambda:*",
47+
"Resource": "*"
48+
},
49+
{
50+
"Effect": "Allow",
51+
"Action": "application-autoscaling:*",
52+
"Resource": "*"
53+
},
54+
{
55+
"Effect": "Allow",
56+
"Action": "rds:*",
57+
"Resource": "*"
58+
},
59+
{
60+
"Effect": "Allow",
61+
"Action": "sns:*",
62+
"Resource": "*"
63+
},
64+
{
65+
"Effect": "Allow",
66+
"Action": "logs:*",
67+
"Resource": "*"
68+
},
69+
{
70+
"Effect": "Allow",
71+
"Action": "organizations:*",
72+
"Resource": "*"
73+
},
74+
{
75+
"Effect": "Allow",
76+
"Action": "account:*",
77+
"Resource": "*"
78+
}
79+
]
80+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# OPA example
2+
3+
This folder contains example [Open Policy Agent (OPA)](https://www.openpolicyagent.org/) policy that enforces all
4+
module source URLs come from the `brikis98` GitHub org.
5+
6+
For more info, please see Chapter 9, "How to test Terraform code", of
7+
*[Terraform: Up and Running](http://www.terraformupandrunning.com)*.
8+
9+
## Quick start
10+
11+
The best way to run this test is with Terratest. See
12+
[opa_test.go](../../terraform/09-testing-terraform-code/test/opa_test.go).
13+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package enforce_source
2+
3+
allow = true {
4+
count(violation) == 0
5+
}
6+
7+
violation[module_label] {
8+
some module_label, i
9+
startswith(input.module[module_label][i].source, "github.com/brikis98") == false
10+
}

code/packer/01-why-terraform/webserver.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"instance_type": "t2.micro",
55
"region": "us-east-2",
66
"type": "amazon-ebs",
7-
"source_ami": "ami-0c55b159cbfafe1f0",
7+
"source_ami": "ami-0fb653ca2d3203ac1",
88
"ssh_username": "ubuntu"
99
}],
1010
"provisioners": [{

0 commit comments

Comments
 (0)