Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the correct example by ajaxian79 #3

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 25 additions & 15 deletions backend/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,50 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "5.23.1"
version = "5.24.0"
}
}
}

provider "aws" {
region = "us-east-1" # Replace with your desired AWS region
region = "us-east-1"
}

resource "random_string" "bucket_prefix" {
length = 8
special = false
resource "aws_s3_bucket" "example" {
bucket = "bucket-tfstate"
}

resource "aws_s3_bucket" "default" {
bucket = "${random_string.bucket_prefix.result}-bucket-tfstate"
}

resource "aws_s3_bucket_versioning" "versioning_example" {
bucket = aws_s3_bucket.default.id
resource "aws_s3_bucket_versioning" "example" {
bucket = aws_s3_bucket.example.id
versioning_configuration {
status = "Enabled"
}
}

resource "aws_s3_bucket_acl" "example" {
bucket = aws_s3_bucket.default.id
acl = "private"
}
resource "aws_s3_bucket_public_access_block" "example" {
bucket = aws_s3_bucket.example.id

block_public_acls = true
block_public_policy = true
ignore_public_acls = true
restrict_public_buckets = true
}

resource "aws_dynamodb_table" "DiggerDynamoDBLockTable" {
name = "DiggerDynamoDBLockTable"
billing_mode = "PAY_PER_REQUEST"
stream_enabled = true
stream_view_type = "NEW_AND_OLD_IMAGES"
hash_key = "PK"
range_key = "SK"

attribute {
name = "PK"
type = "S"
}

attribute {
name = "SK"
type = "S"
}
}
Loading