Skip to content

Commit

Permalink
Merge pull request #2 from clouddrove/CD-90
Browse files Browse the repository at this point in the history
Cd 90
  • Loading branch information
anmolnagpal authored Dec 27, 2019
2 parents 95254e7 + 5e87f07 commit 135bb8d
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 27 deletions.
32 changes: 19 additions & 13 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,42 @@ jobs:
- name: 'Checkout'
uses: actions/checkout@master

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2

- name: 'Terraform Format'
uses: clouddrove/github-actions@v1.0
uses: clouddrove/github-actions@v2.0
with:
actions_subcommand: 'fmt'

- name: 'Terraform Init'
uses: clouddrove/github-actions@v1.0
uses: clouddrove/github-actions@v2.0
with:
actions_subcommand: 'init'
tf_actions_working_dir: ./_example

- name: Configure AWS Credentials
uses: clouddrove/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2

- name: 'Terraform Plan'
uses: clouddrove/[email protected]
with:
actions_subcommand: 'plan'
tf_actions_working_dir: ./_example
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: 'Terratest'
uses: clouddrove/github-actions@v1.0
uses: clouddrove/github-actions@v2.0
with:
actions_subcommand: 'terratest'
tf_actions_working_dir: ./_test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

- name: 'Slack Notification'
uses: 8398a7/action-slack@v2
uses: clouddrove/action-slack@v2
with:
status: ${{ job.status }}
fields: repo,author
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ Here is an example of how you can use this module in your inventory structure:
name = "kms"
application = "clouddrove"
environment = "test"
enabled = true
label_order = ["environment", "name", "application"]
description = "KMS key for cloudtrail"
deletion_window_in_days = 7
Expand Down
27 changes: 14 additions & 13 deletions README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ usage : |-
```hcl
module "kms_key" {
source = "git::https://github.com/clouddrove/terraform-aws-kms.git?ref=tags/0.12.2"
name = "kms"
application = "clouddrove"
environment = "test"
label_order = ["environment", "name", "application"]
name = "kms"
application = "clouddrove"
environment = "test"
label_order = ["environment", "name", "application"]
enabled = true
description = "KMS key for cloudtrail"
deletion_window_in_days = 7
enable_key_rotation = true
Expand Down Expand Up @@ -72,7 +73,7 @@ usage : |-
condition {
test = "StringLike"
variable = "kms:EncryptionContext:aws:cloudtrail:arn"
values = ["arn:aws:cloudtrail:*:XXXXXXXXXXXX:trail/*"]
values = ["arn:aws:cloudtrail:*:XXXXXXXXXXXX:trail/*"]
}
}
Expand All @@ -94,21 +95,21 @@ usage : |-
type = "AWS"
identifiers = ["*"]
}
actions = [
"kms:Decrypt",
"kms:ReEncryptFrom"
actions = [
"kms:Decrypt",
"kms:ReEncryptFrom"
]
resources = ["*"]
condition {
test = "StringEquals"
test = "StringEquals"
variable = "kms:CallerAccount"
values = [
"XXXXXXXXXXXX"]
"XXXXXXXXXXXX"]
}
condition {
test = "StringLike"
variable = "kms:EncryptionContext:aws:cloudtrail:arn"
values = ["arn:aws:cloudtrail:*:XXXXXXXXXXXX:trail/*"]
test = "StringLike"
variable = "kms:EncryptionContext:aws:cloudtrail:arn"
values = ["arn:aws:cloudtrail:*:XXXXXXXXXXXX:trail/*"]
}
}
Expand Down
3 changes: 2 additions & 1 deletion _example/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ provider "aws" {
}

module "kms_key" {
source = "git::https://github.com/clouddrove/terraform-aws-kms.git?ref=tags/0.12.2"
source = "./../"


name = "kms"
application = "clouddrove"
Expand Down

0 comments on commit 135bb8d

Please sign in to comment.