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

resource/aws_emr_cluster: Set SchemaConfigModeAttr on step configuration block attribute #8228

Merged
merged 1 commit into from
Apr 9, 2019

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Apr 6, 2019

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

References:

In Terraform 0.12, behaviors with configuration blocks are more explicit to allow configuration language improvements and remove ambiguities that required various undocumented workarounds in Terraform 0.11 and prior. As a consequence, configuration blocks that are marked Optional: true and Computed: true will no longer support explicitly zero-ing out the configuration without special implementation.

The ConfigMode schema parameter on the configuration block attribute allows the schema to override certain behaviors. In particular, setting ConfigMode: schema.SchemaConfigModeAttr will allow practitioners to continue setting the configuration block attribute to an empty list (in the semantic sense, e.g. attr = []), keeping this prior behavior in Terraform 0.12. This parameter does not have any effect with Terraform 0.11. This solution may be temporary or revisited in the future.

Previous output from Terraform 0.11:

--- PASS: TestAccAWSEMRCluster_Step_ConfigMode (828.01s)

Previous output from Terraform 0.12:

--- FAIL: TestAccAWSEMRCluster_Step_ConfigMode (390.69s)
    testing.go:568: Step 4 error: config is invalid: Unsupported argument: An argument named "step" is not expected here. Did you mean to define a block of type "step"?

Output from Terraform 0.11:

--- PASS: TestAccAWSEMRCluster_Step_ConfigMode (764.03s)

Output from Terraform 0.12:

--- PASS: TestAccAWSEMRCluster_Step_ConfigMode (833.49s)

…ion block attribute

References:

* hashicorp/terraform#20505
* hashicorp/terraform#20626

In Terraform 0.12, behaviors with configuration blocks are more explicit to allow configuration language improvements and remove ambiguities that required various undocumented workarounds in Terraform 0.11 and prior. As a consequence, configuration blocks that are marked `Optional: true` and `Computed: true` will no longer support explicitly zero-ing out the configuration without special implementation.

The `ConfigMode` schema parameter on the configuration block attribute allows the schema to override certain behaviors. In particular, setting `ConfigMode: schema.SchemaConfigModeAttr` will allow practitioners to continue setting the configuration block attribute to an empty list (in the semantic sense, e.g. `attr = []`), keeping this prior behavior in Terraform 0.12. This parameter does not have any effect with Terraform 0.11. This solution may be temporary or revisited in the future.

Previous output from Terraform 0.11:

```
--- PASS: TestAccAWSEMRCluster_Step_ConfigMode (828.01s)
```

Previous output from Terraform 0.12:

```
--- FAIL: TestAccAWSEMRCluster_Step_ConfigMode (390.69s)
    testing.go:568: Step 4 error: config is invalid: Unsupported argument: An argument named "step" is not expected here. Did you mean to define a block of type "step"?
```

Output from Terraform 0.11:

```
--- PASS: TestAccAWSEMRCluster_Step_ConfigMode (764.03s)
```

Output from Terraform 0.12:

```
--- PASS: TestAccAWSEMRCluster_Step_ConfigMode (833.49s)
```
@bflad bflad added service/emr Issues and PRs that pertain to the emr service. technical-debt Addresses areas of the codebase that need refactoring or redesign. terraform-0.12 labels Apr 6, 2019
@bflad bflad added this to the 0.12-support milestone Apr 6, 2019
@bflad bflad requested a review from a team April 6, 2019 03:59
@ghost ghost added size/M Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. documentation Introduces or discusses updates to documentation. labels Apr 6, 2019
Copy link
Contributor

@nywilken nywilken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bflad bflad merged commit 27c8a8b into master Apr 9, 2019
@bflad bflad deleted the td-aws_emr_cluster-ConfigMode branch April 9, 2019 21:27
MalloZup added a commit to MalloZup/terraform-provider-libvirt that referenced this pull request Jun 6, 2019
MalloZup added a commit to MalloZup/terraform-provider-libvirt that referenced this pull request Jun 6, 2019
@ghost
Copy link

ghost commented Mar 30, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. service/emr Issues and PRs that pertain to the emr service. size/M Managed by automation to categorize the size of a PR. technical-debt Addresses areas of the codebase that need refactoring or redesign. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants