Skip to content

Commit 76eced9

Browse files
author
Nikita Dugar
authored
Merge pull request #2 from clouddrove/CD-90
Cd 90
2 parents a034d16 + 67ab5e0 commit 76eced9

File tree

10 files changed

+97
-28
lines changed

10 files changed

+97
-28
lines changed

.github/workflows/terraform.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: 'Terraform GitHub Actions'
2+
on:
3+
- pull_request
4+
5+
jobs:
6+
terraform:
7+
name: 'Terraform'
8+
runs-on: ubuntu-latest
9+
steps:
10+
11+
- name: 'Checkout'
12+
uses: actions/checkout@master
13+
14+
- name: 'Terraform Format'
15+
uses: clouddrove/github-actions@v2.0
16+
with:
17+
actions_subcommand: 'fmt'
18+
19+
- name: 'Terraform Init For Generate-certificate-dns'
20+
uses: clouddrove/github-actions@v2.0
21+
with:
22+
actions_subcommand: 'init'
23+
tf_actions_working_dir: ./_example/generate-certificate-dns
24+
25+
- name: 'Terraform Init For Generate-certificate-email'
26+
uses: clouddrove/github-actions@v2.0
27+
with:
28+
actions_subcommand: 'init'
29+
tf_actions_working_dir: ./_example/generate-certificate-email
30+
31+
- name: Configure AWS Credentials
32+
uses: clouddrove/configure-aws-credentials@v1
33+
with:
34+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
35+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
36+
aws-region: us-east-2
37+
38+
- name: 'Terraform Plan For Generate-certificate-dns'
39+
uses: clouddrove/github-actions@v2.0
40+
with:
41+
actions_subcommand: 'plan'
42+
tf_actions_working_dir: ./_example/generate-certificate-dns
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
46+
- name: 'Terraform Plan For Generate-certificate-email'
47+
uses: clouddrove/github-actions@v2.0
48+
with:
49+
actions_subcommand: 'plan'
50+
tf_actions_working_dir: ./_example/generate-certificate-email
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
54+
- name: 'Terratest for Generate-certificate-dns'
55+
uses: clouddrove/github-actions@v2.0
56+
with:
57+
actions_subcommand: 'terratest'
58+
tf_actions_working_dir: ./_test/generate-certificate-dns
59+
60+
- name: 'Terratest for Generate-certificate-email'
61+
uses: clouddrove/github-actions@v2.0
62+
with:
63+
actions_subcommand: 'terratest'
64+
tf_actions_working_dir: ./_test/generate-certificate-email
65+
env:
66+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67+
68+
- name: 'Slack Notification'
69+
uses: clouddrove/action-slack@v2
70+
with:
71+
status: ${{ job.status }}
72+
fields: repo,author
73+
author_name: 'Clouddrove'
74+
env:
75+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required
76+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required
77+
if: always()

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ Here are some examples of how you can use this module in your inventory structur
7070
### ACM with DNS
7171
```hcl
7272
module "acm" {
73-
source = "git::https://github.com/clouddrove/terraform-aws-acm.git"
73+
source = "git::https://github.com/clouddrove/terraform-aws-acm.git?ref=tags/0.12.1"
7474
name = "certificate"
7575
application = "clouddrove"
7676
environment = "test"
77-
label_order = ["environment", "name", "application"]
77+
label_order = ["environment", "application", "name"]
7878
domain_name = "clouddrove.com"
7979
validation_method = "DNS"
8080
dns_validation = false
@@ -85,11 +85,11 @@ module "acm" {
8585
### ACM with Email
8686
```hcl
8787
module "acm" {
88-
source = "git::https://github.com/clouddrove/terraform-aws-acm.git"
88+
source = "git::https://github.com/clouddrove/terraform-aws-acm.git?ref=tags/0.12.1"
8989
name = "certificate"
9090
application = "clouddrove"
9191
environment = "test"
92-
label_order = ["environment", "name", "application"]
92+
label_order = ["environment", "application", "name"]
9393
domain_name = "clouddrove.com"
9494
validation_method = "EMAIL"
9595
validate_certificate = false
@@ -99,11 +99,11 @@ module "acm" {
9999
### ACM with Import Certificate
100100
```hcl
101101
module "acm" {
102-
source = "git::https://github.com/clouddrove/terraform-aws-acm.git"
102+
source = "git::https://github.com/clouddrove/terraform-aws-acm.git?ref=tags/0.12.1"
103103
name = "certificate"
104104
application = "clouddrove"
105105
environment = "test"
106-
label_order = ["environment", "name", "application"]
106+
label_order = ["environment", "application", "name"]
107107
private_key = "./../../../clouddrove-private-key.pem"
108108
certificate_body = "./../../../clouddrove-cert.pem"
109109
certificate_chain = "./../../../clouddrove-chain.crt"

README.yaml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ usage : |-
3636
### ACM with DNS
3737
```hcl
3838
module "acm" {
39-
source = "git::https://github.com/clouddrove/terraform-aws-acm.git?ref=tags/0.12.2"
39+
source = "git::https://github.com/clouddrove/terraform-aws-acm.git?ref=tags/0.12.1"
4040
name = "certificate"
4141
application = "clouddrove"
4242
environment = "test"
@@ -51,8 +51,8 @@ usage : |-
5151
### ACM with Email
5252
```hcl
5353
module "acm" {
54-
source = "git::https://github.com/clouddrove/terraform-aws-acm.git?ref=tags/0.12.2"
55-
name = "certificate"
54+
source = "git::https://github.com/clouddrove/terraform-aws-acm.git?ref=tags/0.12.1"
55+
name = "certificate
5656
application = "clouddrove"
5757
environment = "test"
5858
label_order = ["environment", "name", "application"]
@@ -65,7 +65,7 @@ usage : |-
6565
### ACM with Import Certificate
6666
```hcl
6767
module "acm" {
68-
source = "git::https://github.com/clouddrove/terraform-aws-acm.git?ref=tags/0.12.2"
68+
source = "git::https://github.com/clouddrove/terraform-aws-acm.git?ref=tags/0.12.1"
6969
name = "certificate"
7070
application = "clouddrove"
7171
environment = "test"
@@ -76,11 +76,3 @@ usage : |-
7676
import_certificate = true
7777
}
7878
```
79-
# Contributors to this project
80-
contributors:
81-
- name: "Kamlesh Bhargav"
82-
github: "kamleshbhargav"
83-
- name: "Nikita Dugar"
84-
github: "nikitadugar"
85-
- name: "Sohan Yadav"
86-
github: "sohanyadav"

_example/generate-certificate-dns/example.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ provider "aws" {
33
}
44

55
module "acm" {
6-
source = "git::https://github.com/clouddrove/terraform-aws-acm.git?ref=tags/0.12.2"
6+
source = "./../../"
77

88
name = "certificate"
99
application = "clouddrove"
1010
environment = "test"
11-
label_order = ["environment", "name", "application"]
11+
label_order = ["environment", "application", "name"]
1212

1313
domain_name = "clouddrove.com"
1414
validation_method = "DNS"

_example/generate-certificate-email/example.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ provider "aws" {
33
}
44

55
module "acm" {
6-
source = "git::https://github.com/clouddrove/terraform-aws-acm.git?ref=tags/0.12.2"
6+
source = "./../../"
77

88
name = "certificate"
99
application = "clouddrove"
1010
environment = "test"
11-
label_order = ["environment", "name", "application"]
11+
label_order = ["environment", "application", "name"]
1212

1313
domain_name = "clouddrove.com"
1414
validation_method = "EMAIL"

_example/import-certificate/example.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ provider "aws" {
33
}
44

55
module "acm" {
6-
source = "git::https://github.com/clouddrove/terraform-aws-acm.git?ref=tags/0.12.2"
6+
source = "./../../"
77

88
name = "certificate"
99
application = "clouddrove"
1010
environment = "test"
11-
label_order = ["environment", "name", "application"]
11+
label_order = ["environment", "application", "name"]
1212

1313
private_key = "./../../../clouddrove-private-key.pem"
1414
certificate_body = "./../../../clouddrove-cert.pem"

_test/generate-certificate-dns/acm_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ func Test(t *testing.T) {
2929
Tags := terraform.OutputMap(t, terraformOptions, "tags")
3030

3131
// Check that we get back the outputs that we expect
32-
assert.Equal(t, "test-certificate-clouddrove", Tags["Name"])
32+
assert.Equal(t, "test-clouddrove-certificate", Tags["Name"])
3333
assert.Contains(t, Arn, "arn:aws:acm")
3434
}

_test/generate-certificate-email/acm_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ func Test(t *testing.T) {
2929
Tags := terraform.OutputMap(t, terraformOptions, "tags")
3030

3131
// Check that we get back the outputs that we expect
32-
assert.Equal(t, "test-certificate-clouddrove", Tags["Name"])
32+
assert.Equal(t, "test-clouddrove-certificate", Tags["Name"])
3333
assert.Contains(t, Arn, "arn:aws:acm")
3434
}

_test/import-certificate/acm_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ func TestAcm(t *testing.T) {
2929
Tags := terraform.OutputMap(t, terraformOptions, "tags")
3030

3131
// Check that we get back the outputs that we expect
32-
assert.Equal(t, "test-certificate-clouddrove", Tags["Name"])
32+
assert.Equal(t, "test-clouddrove-certificate", Tags["Name"])
3333
assert.Contains(t, Arn, "arn:aws:acm")
3434
}

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# for resources. You can use terraform-labels to implement a strict naming
88
# convention.
99
module "labels" {
10-
source = "git::https://github.com/clouddrove/terraform-labels.git"
10+
source = "git::https://github.com/clouddrove/terraform-labels.git?ref=tags/0.12.0"
1111

1212
name = var.name
1313
application = var.application

0 commit comments

Comments
 (0)