Skip to content

Commit 3aa2a5b

Browse files
author
Nikita Dugar
authored
Merge pull request #8 from clouddrove/CD-249
updated ssh key to dynamic
2 parents 707ea90 + 1e219c8 commit 3aa2a5b

File tree

11 files changed

+217
-168
lines changed

11 files changed

+217
-168
lines changed

.github/workflows/readme.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: 'Create README.md file'
2+
on:
3+
push:
4+
branches:
5+
- master
6+
7+
jobs:
8+
readme-create:
9+
name: 'readme-create'
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: 'Checkout'
13+
uses: actions/checkout@master
14+
15+
- name: Set up Python 3.7.
16+
uses: actions/setup-python@v2
17+
with:
18+
python-version: '3.x'
19+
20+
- name: 'create readme'
21+
uses: 'clouddrove/[email protected]'
22+
with:
23+
actions_subcommand: 'readme'
24+
github_token: '${{ secrets.GITHUB}}'
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}
27+
28+
29+
- name: pre-commit check errors
30+
uses: pre-commit/[email protected]
31+
continue-on-error: true
32+
33+
- name: pre-commit fix erros
34+
uses: pre-commit/[email protected]
35+
continue-on-error: true
36+
37+
- name: 'push readme'
38+
uses: 'clouddrove/[email protected]'
39+
continue-on-error: true
40+
with:
41+
actions_subcommand: 'push'
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}
44+
45+
- name: 'Slack Notification'
46+
uses: clouddrove/action-slack@v2
47+
with:
48+
status: ${{ job.status }}
49+
fields: repo,author
50+
author_name: 'CloudDrove'
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required
53+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }} # required
54+
if: always()

.github/workflows/terraform.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: 'Terraform GitHub Actions'
2+
on:
3+
pull_request:
4+
branches:
5+
- master
6+
7+
jobs:
8+
terraform:
9+
name: 'Terraform'
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: 'Checkout'
13+
uses: actions/checkout@master
14+
15+
- name: Configure AWS Credentials
16+
uses: clouddrove/configure-aws-credentials@v1
17+
with:
18+
aws-access-key-id: ${{ secrets.TEST_AWS_ACCESS_KEY }}
19+
aws-secret-access-key: ${{ secrets.TEST_AWS_ACCESS_SECRET_KEY }}
20+
aws-region: us-east-2
21+
22+
23+
- name: 'Terraform Format'
24+
uses: 'clouddrove/[email protected]'
25+
with:
26+
actions_subcommand: 'fmt'
27+
28+
- name: 'Terraform init'
29+
uses: 'clouddrove/[email protected]'
30+
with:
31+
actions_subcommand: 'init'
32+
tf_actions_working_dir: ./_example
33+
34+
- name: 'Terraform validate'
35+
uses: 'clouddrove/[email protected]'
36+
with:
37+
actions_subcommand: 'validate'
38+
tf_actions_working_dir: ./_example
39+
40+
- name: 'Terraform plan'
41+
uses: 'clouddrove/[email protected]'
42+
with:
43+
actions_subcommand: 'plan'
44+
tf_actions_working_dir: ./_example
45+
46+
- name: 'Slack Notification'
47+
uses: clouddrove/action-slack@v2
48+
with:
49+
status: ${{ job.status }}
50+
fields: repo,author
51+
author_name: 'CloudDrove'
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required
54+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }} # required
55+
if: always()

.github/workflows/terratest.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: 'Terratest GitHub Actions'
2+
on:
3+
pull_request:
4+
branches:
5+
- master
6+
types: [labeled]
7+
8+
jobs:
9+
terraform:
10+
name: 'Terraform'
11+
runs-on: ubuntu-latest
12+
steps:
13+
14+
- name: 'Checkout'
15+
uses: actions/checkout@master
16+
17+
- name: Configure AWS Credentials
18+
uses: clouddrove/configure-aws-credentials@v1
19+
with:
20+
aws-access-key-id: ${{ secrets.TEST_AWS_ACCESS_KEY }}
21+
aws-secret-access-key: ${{ secrets.TEST_AWS_ACCESS_SECRET_KEY }}
22+
aws-region: us-east-2
23+
24+
25+
- name: 'Terratest'
26+
if: ${{ github.event.label.name == 'terratest' }}
27+
uses: 'clouddrove/[email protected]'
28+
with:
29+
actions_subcommand: 'terratest'
30+
tf_actions_working_dir: '_test'
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
34+
- name: 'Slack Notification'
35+
uses: clouddrove/action-slack@v2
36+
with:
37+
status: ${{ job.status }}
38+
fields: repo,author
39+
author_name: 'CloudDrove'
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required
42+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }} # required
43+
if: always()

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
repos:
22
- repo: git://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.12.0
3+
rev: v1.43.0
44
hooks:
55
- id: terraform_fmt
66

77
- repo: https://github.com/pre-commit/pre-commit-hooks
8-
rev: v2.0.0
8+
rev: v3.2.0
99
hooks:
1010
- id: check-merge-conflict
11-
- id: trailing-whitespace
1211
- id: check-yaml
1312
- id: check-added-large-files
13+
- id: trailing-whitespace

README.md

Lines changed: 0 additions & 149 deletions
This file was deleted.

README.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ github_repo: clouddrove/terraform-aws-sftp
1616
# Badges to display
1717
badges:
1818
- name: "Terraform"
19-
image: "https://img.shields.io/badge/Terraform-v0.12-green"
19+
image: "https://img.shields.io/badge/terraform-v0.13-green"
2020
url: "https://www.terraform.io"
2121
- name: "Licence"
2222
image: "https://img.shields.io/badge/License-MIT-blue.svg"
@@ -36,7 +36,8 @@ usage : |-
3636
Here is an example of how you can use this module in your inventory structure:
3737
```hcl
3838
module "sftp" {
39-
source = "git::https://github.com/clouddrove/terraform-aws-sftp.git?ref=tags/0.12.2"
39+
source = "clouddrove/sftp/aws"
40+
version = "0.13.0"
4041
name = "sftp"
4142
application = "clouddrove"
4243
environment = "test"
@@ -45,5 +46,6 @@ usage : |-
4546
user_name = "ftp-user"
4647
enable_sftp = true
4748
s3_bucket_id = clouddrove_dev_s3_bucket
49+
endpoint_type = "PUBLIC"
4850
}
4951
```

_example/example.tf

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

55
module "s3_bucket" {
6-
source = "git::https://github.com/clouddrove/terraform-aws-s3.git?ref=tags/0.12.1"
7-
8-
name = "secure-bucket"
6+
source = "clouddrove/s3/aws"
7+
version = "0.13.0"
8+
name = "secure-buc"
99
application = "clouddrove"
1010
environment = "test"
1111
label_order = ["environment", "name", "application"]
1212

13-
region = "eu-west-1"
13+
1414
versioning = true
1515
acl = "private"
1616
bucket_enabled = true
@@ -24,8 +24,9 @@ module "sftp" {
2424
environment = "test"
2525
label_order = ["environment", "name", "application"]
2626

27-
key_path = "~/.ssh/id_rsa.pub"
28-
user_name = "ftp-user"
29-
enable_sftp = true
30-
s3_bucket_id = module.s3_bucket.id
27+
key_path = "~/.ssh/id_rsa.pub"
28+
user_name = "ftp-user"
29+
enable_sftp = true
30+
s3_bucket_id = module.s3_bucket.id
31+
endpoint_type = "PUBLIC"
3132
}

_test/go.mod

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module github.com/clouddrove/terraform-aws-sftp/_example
2+
3+
go 1.13
4+
5+
require (
6+
github.com/gruntwork-io/terratest v0.30.6
7+
github.com/stretchr/testify v1.6.1
8+
)

0 commit comments

Comments
 (0)