Skip to content

Commit 92a3ade

Browse files
Replaced deprecated arguments policy documents (#214)
* Replaced deprecated usage of override_json with override_policy_document. See https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document#override_json * Changed default value of extended_ec2_policy_document to ensure behavior is covered by unit tests in provider. See https://github.com/hashicorp/terraform-provider-aws/blob/1a133f077a7f0660d28f8bb905f89946c695ceb1/internal/service/iam/policy_document_data_source_test.go#L1513 * Auto Format Co-authored-by: cloudpossebot <[email protected]>
1 parent 410879e commit 92a3ade

File tree

6 files changed

+8
-7
lines changed

6 files changed

+8
-7
lines changed

.github/auto-release.yml

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ version-resolver:
1717
- 'bugfix'
1818
- 'bug'
1919
- 'hotfix'
20-
- 'no-release'
2120
default: 'minor'
2221

2322
categories:

.github/workflows/validate-codeowners.yml

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jobs:
1010
steps:
1111
- name: "Checkout source code at current commit"
1212
uses: actions/checkout@v2
13+
# Leave pinned at 0.7.1 until https://github.com/mszostok/codeowners-validator/issues/173 is resolved
1314
- uses: mszostok/[email protected]
1415
if: github.event.pull_request.head.repo.full_name == github.repository
1516
name: "Full check of CODEOWNERS"

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ Available targets:
340340
| <a name="input_env_vars"></a> [env\_vars](#input\_env\_vars) | Map of custom ENV variables to be provided to the application running on Elastic Beanstalk, e.g. env\_vars = { DB\_USER = 'admin' DB\_PASS = 'xxxxxx' } | `map(string)` | `{}` | no |
341341
| <a name="input_environment"></a> [environment](#input\_environment) | ID element. Usually used for region e.g. 'uw2', 'us-west-2', OR role 'prod', 'staging', 'dev', 'UAT' | `string` | `null` | no |
342342
| <a name="input_environment_type"></a> [environment\_type](#input\_environment\_type) | Environment type, e.g. 'LoadBalanced' or 'SingleInstance'. If setting to 'SingleInstance', `rolling_update_type` must be set to 'Time', `updating_min_in_service` must be set to 0, and `loadbalancer_subnets` will be unused (it applies to the ELB, which does not exist in SingleInstance environments) | `string` | `"LoadBalanced"` | no |
343-
| <a name="input_extended_ec2_policy_document"></a> [extended\_ec2\_policy\_document](#input\_extended\_ec2\_policy\_document) | Extensions or overrides for the IAM role assigned to EC2 instances | `string` | `"{}"` | no |
343+
| <a name="input_extended_ec2_policy_document"></a> [extended\_ec2\_policy\_document](#input\_extended\_ec2\_policy\_document) | Extensions or overrides for the IAM role assigned to EC2 instances | `string` | `""` | no |
344344
| <a name="input_force_destroy"></a> [force\_destroy](#input\_force\_destroy) | Force destroy the S3 bucket for load balancer logs | `bool` | `false` | no |
345345
| <a name="input_health_streaming_delete_on_terminate"></a> [health\_streaming\_delete\_on\_terminate](#input\_health\_streaming\_delete\_on\_terminate) | Whether to delete the log group when the environment is terminated. If false, the health data is kept RetentionInDays days. | `bool` | `false` | no |
346346
| <a name="input_health_streaming_enabled"></a> [health\_streaming\_enabled](#input\_health\_streaming\_enabled) | For environments with enhanced health reporting enabled, whether to create a group in CloudWatch Logs for environment health and archive Elastic Beanstalk environment health data. For information about enabling enhanced health, see aws:elasticbeanstalk:healthreporting:system. | `bool` | `false` | no |
@@ -616,7 +616,7 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply
616616

617617
[![README Footer][readme_footer_img]][readme_footer_link]
618618
[![Beacon][beacon]][website]
619-
619+
<!-- markdownlint-disable -->
620620
[logo]: https://cloudposse.com/logo-300x69.svg
621621
[docs]: https://cpco.io/docs?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-elastic-beanstalk-environment&utm_content=docs
622622
[website]: https://cpco.io/homepage?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-elastic-beanstalk-environment&utm_content=website
@@ -647,3 +647,4 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply
647647
[share_googleplus]: https://plus.google.com/share?url=https://github.com/cloudposse/terraform-aws-elastic-beanstalk-environment
648648
[share_email]: mailto:?subject=terraform-aws-elastic-beanstalk-environment&body=https://github.com/cloudposse/terraform-aws-elastic-beanstalk-environment
649649
[beacon]: https://ga-beacon.cloudposse.com/UA-76589703-4/cloudposse/terraform-aws-elastic-beanstalk-environment?pixel&cs=github&cm=readme&an=terraform-aws-elastic-beanstalk-environment
650+
<!-- markdownlint-restore -->

docs/terraform.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
| <a name="input_env_vars"></a> [env\_vars](#input\_env\_vars) | Map of custom ENV variables to be provided to the application running on Elastic Beanstalk, e.g. env\_vars = { DB\_USER = 'admin' DB\_PASS = 'xxxxxx' } | `map(string)` | `{}` | no |
9696
| <a name="input_environment"></a> [environment](#input\_environment) | ID element. Usually used for region e.g. 'uw2', 'us-west-2', OR role 'prod', 'staging', 'dev', 'UAT' | `string` | `null` | no |
9797
| <a name="input_environment_type"></a> [environment\_type](#input\_environment\_type) | Environment type, e.g. 'LoadBalanced' or 'SingleInstance'. If setting to 'SingleInstance', `rolling_update_type` must be set to 'Time', `updating_min_in_service` must be set to 0, and `loadbalancer_subnets` will be unused (it applies to the ELB, which does not exist in SingleInstance environments) | `string` | `"LoadBalanced"` | no |
98-
| <a name="input_extended_ec2_policy_document"></a> [extended\_ec2\_policy\_document](#input\_extended\_ec2\_policy\_document) | Extensions or overrides for the IAM role assigned to EC2 instances | `string` | `"{}"` | no |
98+
| <a name="input_extended_ec2_policy_document"></a> [extended\_ec2\_policy\_document](#input\_extended\_ec2\_policy\_document) | Extensions or overrides for the IAM role assigned to EC2 instances | `string` | `""` | no |
9999
| <a name="input_force_destroy"></a> [force\_destroy](#input\_force\_destroy) | Force destroy the S3 bucket for load balancer logs | `bool` | `false` | no |
100100
| <a name="input_health_streaming_delete_on_terminate"></a> [health\_streaming\_delete\_on\_terminate](#input\_health\_streaming\_delete\_on\_terminate) | Whether to delete the log group when the environment is terminated. If false, the health data is kept RetentionInDays days. | `bool` | `false` | no |
101101
| <a name="input_health_streaming_enabled"></a> [health\_streaming\_enabled](#input\_health\_streaming\_enabled) | For environments with enhanced health reporting enabled, whether to create a group in CloudWatch Logs for environment health and archive Elastic Beanstalk environment health data. For information about enabling enhanced health, see aws:elasticbeanstalk:healthreporting:system. | `bool` | `false` | no |

main.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,8 @@ data "aws_iam_policy_document" "default" {
331331
data "aws_iam_policy_document" "extended" {
332332
count = local.enabled ? 1 : 0
333333

334-
source_json = join("", data.aws_iam_policy_document.default.*.json)
335-
override_json = var.extended_ec2_policy_document
334+
source_json = join("", data.aws_iam_policy_document.default.*.json)
335+
override_policy_documents = [var.extended_ec2_policy_document]
336336
}
337337

338338
resource "aws_iam_instance_profile" "ec2" {

variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ variable "deployment_timeout" {
473473

474474
variable "extended_ec2_policy_document" {
475475
type = string
476-
default = "{}"
476+
default = ""
477477
description = "Extensions or overrides for the IAM role assigned to EC2 instances"
478478
}
479479

0 commit comments

Comments
 (0)