-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
03dfd52
commit e9e0ed0
Showing
7 changed files
with
188 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
terraform { | ||
required_providers { | ||
aws = { | ||
source = "hashicorp/aws" | ||
version = "~> 5.50.0" | ||
} | ||
} | ||
} | ||
|
||
resource "aws_s3control_multi_region_access_point" "mrap" { | ||
count = var.create_mrap ? 1 : 0 | ||
|
||
details { | ||
name = var.mrap_name | ||
|
||
region { | ||
bucket = var.mrap_bucket_names[0] | ||
} | ||
|
||
region { | ||
bucket = var.mrap_bucket_names[1] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
output "arn" { | ||
value = aws_s3control_multi_region_access_point.mrap[0].arn | ||
} | ||
|
||
output "alias" { | ||
value = aws_s3control_multi_region_access_point.mrap[0].alias | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# variable "version" { | ||
# description = "The module version" | ||
# type = string | ||
# } | ||
|
||
variable "create_mrap" { | ||
description = "Whether to create MRAP or not" | ||
type = bool | ||
} | ||
|
||
variable "mrap_name" { | ||
description = "The name of the MRAP" | ||
type = string | ||
} | ||
|
||
variable "mrap_bucket_names" { | ||
description = "The bucket names for the MRAP" | ||
type = list(string) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
terraform { | ||
required_providers { | ||
aws = { | ||
source = "hashicorp/aws" | ||
version = "~> 5.50.0" | ||
} | ||
} | ||
} | ||
|
||
resource "aws_vpc_endpoint" "endpoint" { | ||
vpc_endpoint_type = "Interface" | ||
vpc_id = var.vpc_id | ||
service_name = var.configuration.service_name | ||
subnet_ids = var.subnet_ids | ||
# security_group_ids = var.security_group_ids | ||
private_dns_enabled = var.private_dns_only_for_inbound_resolver_endpoint | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
output "id" { | ||
value = aws_vpc_endpoint.endpoint.id | ||
} | ||
|
||
output "dns" { | ||
value = aws_vpc_endpoint.endpoint.dns_entry[0].dns_name | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# variable "version" { | ||
# description = "The module version" | ||
# type = string | ||
# } | ||
|
||
variable "private_dns_only_for_inbound_resolver_endpoint" { | ||
description = "Private DNS only for inbound resolver endpoint" | ||
type = bool | ||
} | ||
|
||
variable "configuration" { | ||
description = "The configuration for the VPC endpoint" | ||
type = object({ | ||
service_name = string | ||
subnet_type = string | ||
region = string | ||
}) | ||
} | ||
|
||
variable "vpc_id" { | ||
description = "The VPC ID" | ||
type = string | ||
default = "VPC_ID_HERE" | ||
} | ||
|
||
variable "subnet_ids" { | ||
description = "The subnet IDs" | ||
type = list(string) | ||
default = ["SUBNET_IDS_HERE"] | ||
} | ||
|
||
variable "security_group_ids" { | ||
description = "The security group IDs" | ||
type = list(string) | ||
default = ["SECURITY_GROUP_IDS_HERE"] | ||
} |