Skip to content

Commit 4af7260

Browse files
author
Dobroslav Slavenskoj
committed
rebase
1 parent c5876bc commit 4af7260

File tree

4 files changed

+45
-9
lines changed

4 files changed

+45
-9
lines changed

.github/workflows/digger-plan.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,15 @@ jobs:
1919
uses: diggerhq/digger@v0.2.0
2020
with:
2121
setup-aws: true
22-
aws-role-to-assume: arn:aws:sts::${{ secrets.AccountID }}:assumed-role/${{secrets.RoleName}}/${{FunctionName}}
22+
23+
#Uncomment below line if using OIDC
24+
#aws-role-to-assume: arn:aws:sts::{secrets.AccountID}:assumed-role/{secrets.RoleName}/{FunctionName}
25+
26+
#Comment the following two lines out if using OIDC.
27+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
28+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
29+
##End comment block
2330
aws-region: us-east-1
2431
env:
2532
GITHUB_CONTEXT: ${{ toJson(github) }}
2633
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27-
LOCK_PROVIDER: aws
28-
AWS_STORAGE_BUCKET: 'digger-lock-prod'
29-

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ gcp_key.json
22

33
# Local .terraform directories
44
**/.terraform/*
5-
5+
.terraform
66
# .tfstate files
77
*.tfstate
88
*.tfstate.*

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,17 @@
11
# quickstart-actions-aws
2+
3+
This is the repository for a sample quickstart action with digger.
4+
5+
# backend
6+
this folder will provision (most) of the backend required.
7+
Main.tf provisions the following resources.
8+
9+
1. The Backend state bucket for terraform to store state in
10+
2. The required DynamoDB table for Digger to store locks.
11+
12+
# prod
13+
This is a sample terraform prod code that will (if given the chance) spin up a vpc + an EC2 instance, and required security groups.
14+
The instance is locked down to not be accessible from outside the network.
15+
16+
# .github/workflows
17+
Contains digger-plan.yml with two different potential ways of authenticating against an AWS account. Please review the main digger documentation on details as to which scheme to use.

backend/main.tf

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_providers {
33
aws = {
44
source = "hashicorp/aws"
5-
version = "3.0.0" # Use an appropriate version
5+
version = "5.23.1"
66
}
77
}
88
}
@@ -18,8 +18,24 @@ resource "random_string" "bucket_prefix" {
1818

1919
resource "aws_s3_bucket" "default" {
2020
bucket = "${random_string.bucket_prefix.result}-bucket-tfstate"
21-
acl = "private" # You can adjust the ACL as needed
22-
versioning {
23-
enabled = true
21+
}
22+
23+
resource "aws_s3_bucket_versioning" "versioning_example" {
24+
bucket = aws_s3_bucket.default.id
25+
versioning_configuration {
26+
status = "Enabled"
2427
}
2528
}
29+
30+
resource "aws_s3_bucket_acl" "example" {
31+
bucket = aws_s3_bucket.default.id
32+
acl = "private"
33+
}
34+
35+
36+
resource "aws_dynamodb_table" "DiggerDynamoDBLockTable" {
37+
name = "DiggerDynamoDBLockTable"
38+
billing_mode = "PAY_PER_REQUEST"
39+
stream_enabled = true
40+
stream_view_type = "NEW_AND_OLD_IMAGES"
41+
}

0 commit comments

Comments
 (0)