Skip to content

Commit

Permalink
Use the correct example by ajaxian79
Browse files Browse the repository at this point in the history
  • Loading branch information
ZIJ authored Nov 6, 2023
1 parent 3455728 commit f72ec6e
Showing 1 changed file with 25 additions and 15 deletions.
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"
}
}

0 comments on commit f72ec6e

Please sign in to comment.