Skip to content

Commit 055f7f2

Browse files
author
ignacioli
authored
revert: support loki bucket for aws BYOC poolmembers (#169)
Reverts #167
1 parent ee192f3 commit 055f7f2

File tree

4 files changed

+14
-32
lines changed

4 files changed

+14
-32
lines changed

modules/dns-bucket/README.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ A basic module used to create Route53 Zone and S3 Buckets.
2828

2929
| Name | Version |
3030
|------|---------|
31-
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.75.0 |
32-
| <a name="provider_aws.source"></a> [aws.source](#provider\_aws.source) | 5.75.0 |
33-
| <a name="provider_aws.target"></a> [aws.target](#provider\_aws.target) | 5.75.0 |
31+
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.76.0 |
32+
| <a name="provider_aws.source"></a> [aws.source](#provider\_aws.source) | 5.76.0 |
33+
| <a name="provider_aws.target"></a> [aws.target](#provider\_aws.target) | 5.76.0 |
3434

3535
## Modules
3636

@@ -42,7 +42,6 @@ No modules.
4242
|------|------|
4343
| [aws_route53_record.delegate](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_record) | resource |
4444
| [aws_route53_zone.zone](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_zone) | resource |
45-
| [aws_s3_bucket.loki](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket) | resource |
4645
| [aws_s3_bucket.tiered_storage](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket) | resource |
4746
| [aws_s3_bucket.velero](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket) | resource |
4847
| [aws_s3_bucket_server_side_encryption_configuration.velero](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_server_side_encryption_configuration) | resource |
@@ -53,14 +52,11 @@ No modules.
5352

5453
| Name | Description | Type | Default | Required |
5554
|------|-------------|------|---------|:--------:|
56-
| <a name="input_bucket_location"></a> [bucket\_location](#input\_bucket\_location) | The location of the bucket | `string` | n/a | yes |
5755
| <a name="input_custom_dns_zone_id"></a> [custom\_dns\_zone\_id](#input\_custom\_dns\_zone\_id) | if specified, then a streamnative zone will not be created, and this zone will be used instead. Otherwise, we will provision a new zone and delegate access | `string` | `""` | no |
5856
| <a name="input_custom_dns_zone_name"></a> [custom\_dns\_zone\_name](#input\_custom\_dns\_zone\_name) | must be passed if custom\_dns\_zone\_id is passed, this is the zone name to use | `string` | `""` | no |
59-
| <a name="input_enable_loki"></a> [enable\_loki](#input\_enable\_loki) | Enable loki storage bucket creation | `bool` | `false` | no |
6057
| <a name="input_extra_aws_tags"></a> [extra\_aws\_tags](#input\_extra\_aws\_tags) | Additional to apply to the resources. Note that this module sets the tags Name, Type, and Vendor by default. They can be overwritten, but it is not recommended. | `map(string)` | `{}` | no |
6158
| <a name="input_parent_zone_name"></a> [parent\_zone\_name](#input\_parent\_zone\_name) | The parent zone in which we create the delegation records | `string` | n/a | yes |
6259
| <a name="input_pm_name"></a> [pm\_name](#input\_pm\_name) | The name of the poolmember, for new clusters, this should be like `pm-<xxxxx>` | `string` | n/a | yes |
63-
| <a name="input_pm_namespace"></a> [pm\_namespace](#input\_pm\_namespace) | The namespace of the poolmember | `string` | n/a | yes |
6460
| <a name="input_s3_encryption_kms_key_arn"></a> [s3\_encryption\_kms\_key\_arn](#input\_s3\_encryption\_kms\_key\_arn) | KMS key ARN to use for S3 encryption. If not set, the default AWS S3 key will be used. | `string` | `""` | no |
6561

6662
## Outputs
@@ -69,7 +65,6 @@ No modules.
6965
|------|-------------|
7066
| <a name="output_backup_bucket"></a> [backup\_bucket](#output\_backup\_bucket) | n/a |
7167
| <a name="output_backup_bucket_kms_key_id"></a> [backup\_bucket\_kms\_key\_id](#output\_backup\_bucket\_kms\_key\_id) | n/a |
72-
| <a name="output_loki_bucket"></a> [loki\_bucket](#output\_loki\_bucket) | n/a |
7368
| <a name="output_tiered_storage_bucket"></a> [tiered\_storage\_bucket](#output\_tiered\_storage\_bucket) | n/a |
7469
| <a name="output_zone_id"></a> [zone\_id](#output\_zone\_id) | n/a |
7570
| <a name="output_zone_name"></a> [zone\_name](#output\_zone\_name) | n/a |

modules/dns-bucket/bucket.tf

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,27 @@
1313
# limitations under the License.
1414

1515
resource "aws_s3_bucket" "velero" {
16-
provider = aws.target
1716
bucket = format("%s-cluster-backup-snc", var.pm_name)
1817
tags = merge({ "Attributes" = "backup", "Name" = "velero-backups" }, local.tags)
1918
force_destroy = true
19+
20+
lifecycle {
21+
ignore_changes = [
22+
bucket,
23+
]
24+
}
2025
}
2126

2227
resource "aws_s3_bucket" "tiered_storage" {
23-
provider = aws.target
2428
bucket = format("%s-tiered-storage-snc", var.pm_name)
2529
tags = merge({ "Attributes" = "tiered-storage" }, local.tags)
2630
force_destroy = true
27-
}
2831

29-
resource "aws_s3_bucket" "loki" {
30-
count = var.enable_loki ? 1 : 0
31-
provider = aws.source
32-
bucket = format("loki-%s-%s", var.pm_namespace, var.pm_name)
33-
tags = merge({ "Attributes" = "loki", "Name" = "logs-byoc" }, local.tags)
34-
force_destroy = true
32+
lifecycle {
33+
ignore_changes = [
34+
bucket,
35+
]
36+
}
3537
}
3638

3739
data "aws_kms_key" "s3_default" {

modules/dns-bucket/outputs.tf

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,4 @@ output "backup_bucket_kms_key_id" {
3030

3131
output "tiered_storage_bucket" {
3232
value = aws_s3_bucket.tiered_storage.bucket
33-
}
34-
35-
output "loki_bucket" {
36-
value = var.enable_loki ? aws_s3_bucket.loki[0].bucket : ""
3733
}

modules/dns-bucket/variables.tf

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
variable "pm_namespace" {
16-
type = string
17-
description = "The namespace of the poolmember"
18-
}
19-
2015
variable "pm_name" {
2116
description = "The name of the poolmember, for new clusters, this should be like `pm-<xxxxx>`"
2217
type = string
@@ -56,9 +51,3 @@ locals {
5651
"Vendor" = "StreamNative"
5752
}, var.extra_aws_tags)
5853
}
59-
60-
variable "enable_loki" {
61-
type = bool
62-
default = false
63-
description = "Enable loki storage bucket creation"
64-
}

0 commit comments

Comments
 (0)