Skip to content

Commit

Permalink
feat: add S3 table VPC endpoint configuration (#24)
Browse files Browse the repository at this point in the history
* feat: add .gitignore to exclude sensitive and environment-specific files

* feat: update .gitignore to exclude all Terraform files

* feat: add S3 table VPC endpoint configuration in aws.tf
  • Loading branch information
Gezi-lzq authored Dec 12, 2024
1 parent 74e7d2f commit fde0732
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Terraform files
**/.terraform/*
.terraform.lock.hcl
*.tfstate
*.tfstate.*

# Crash log files
crash.log

# Exclude all .tfvars files, which are likely to contain sensitive data, such as
# passwords, private keys, and other secrets. These should not be part of version
# control as they are data points which are potentially sensitive and subject
# to change depending on the environment.
*.tfvars

# Ignore override files as they are usually used to override resources locally and so
# are not checked in
override.tf
override.tf.json
*_override.tf
*_override.tf.json

# Ignore CLI configuration files
.terraformrc
terraform.rc
.terraform/*

# Ignore editor config files
.editorconfig

# Ignore pre-commit config
.pre-commit-config.yaml

# Ignore release config
.releaserc.json

# Ignore GitHub workflows
.github/

# Ignore OS-specific files
.DS_Store
Thumbs.db

# Ignore IDE-specific files
.vscode/
.idea/
18 changes: 18 additions & 0 deletions aws.tf
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,24 @@ resource "aws_vpc_endpoint" "s3_endpoint" {
}
}

resource "aws_vpc_endpoint" "s3table_endpoint" {
count = var.create_new_vpc ? 1 : 0

vpc_id = module.automq_byoc_vpc[0].vpc_id
service_name = "com.amazonaws.${var.cloud_provider_region}.s3tables"
vpc_endpoint_type = "Interface"
security_group_ids = [aws_security_group.vpc_endpoint_sg[0].id]
subnet_ids = module.automq_byoc_vpc[0].private_subnets

private_dns_enabled = true

tags = {
Name = "automq-byoc-ec2-endpoint-${var.automq_byoc_env_id}"
automqVendor = "automq"
automqEnvironmentID = var.automq_byoc_env_id
}
}

locals {
automq_byoc_vpc_id = var.create_new_vpc ? module.automq_byoc_vpc[0].vpc_id : var.automq_byoc_vpc_id
automq_byoc_env_console_public_subnet_id = var.create_new_vpc ? element(module.automq_byoc_vpc[0].public_subnets, 0) : var.automq_byoc_env_console_public_subnet_id
Expand Down

0 comments on commit fde0732

Please sign in to comment.