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

feat: upgrade aws provider #241

Merged
merged 9 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
### Changed
- Changed `k8s` API to work with provider 2.x
- Changed Terraform `map` to `tomap` to make it work with newer TF provider(The map function was deprecated in Terraform v0.12 and is no longer available).
- Upgrade AWS provider to `4.x`.

## [6.19.1] - 2023-08-25
### Fixed
Expand Down
4 changes: 2 additions & 2 deletions ouputs.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
output "hms_readonly_load_balancers" {
value = var.hms_instance_type == "k8s" && var.enable_vpc_endpoint_services ? kubernetes_service.hms_readonly[0].status.0.load_balancer.0.ingress.0.hostname : []
value = var.hms_instance_type == "k8s" && var.enable_vpc_endpoint_services ? [kubernetes_service.hms_readonly[0].status.0.load_balancer.0.ingress.0.hostname] : []
}

output "hms_readwrite_load_balancers" {
value = var.hms_instance_type == "k8s" && var.enable_vpc_endpoint_services ? kubernetes_service.hms_readwrite[0].status.0.load_balancer.0.ingress.0.hostname : []
value = var.hms_instance_type == "k8s" && var.enable_vpc_endpoint_services ? [kubernetes_service.hms_readwrite[0].status.0.load_balancer.0.ingress.0.hostname] : []
}

output "managed_database_host" {
Expand Down
7 changes: 7 additions & 0 deletions s3-other.tf
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ resource "aws_s3_bucket_ownership_controls" "apiary_inventory_bucket" {
}
}

resource "aws_s3_bucket_acl" "apiary_inventory_bucket" {
count = var.s3_enable_inventory == true ? 1 : 0
depends_on = [aws_s3_bucket_ownership_controls.apiary_inventory_bucket[0]]
bucket = aws_s3_bucket.apiary_inventory_bucket[0].id
acl = "private"
}

resource "aws_s3_bucket" "apiary_managed_logs_bucket" {
count = local.enable_apiary_s3_log_management ? 1 : 0
bucket = local.apiary_s3_logs_bucket
Expand Down
9 changes: 8 additions & 1 deletion s3.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ resource "aws_s3_bucket" "apiary_data_bucket" {
for schema in local.schemas_info : "${schema["schema_name"]}" => schema
}
bucket = each.value["data_bucket"]
acl = "private"
request_payer = "BucketOwner"
policy = local.bucket_policy_map[each.key]
tags = merge(tomap({"Name"=each.value["data_bucket"]}),
Expand Down Expand Up @@ -123,6 +122,14 @@ resource "aws_s3_bucket_ownership_controls" "apiary_bucket" {
}
}

resource "aws_s3_bucket_acl" "apiary_data_bucket" {
for_each = {
for schema in local.schemas_info : "${schema["schema_name"]}" => schema
}
bucket = aws_s3_bucket.apiary_data_bucket[each.key].id
acl = "private"
}

resource "aws_s3_bucket_notification" "data_events" {
for_each = var.enable_data_events ? {
for schema in local.schemas_info : "${schema["schema_name"]}" => schema if lookup(schema, "enable_data_events_sqs", "0") == "0"
Expand Down
2 changes: 1 addition & 1 deletion version.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ terraform {
}
aws = {
source = "hashicorp/aws"
version = "~> 3.0"
version = "~> 4.0"
}
}
}
Loading