Skip to content

Commit

Permalink
Merge pull request #38761 from hashicorp/td-autoflex-more-documentation
Browse files Browse the repository at this point in the history
Updates AutoFlex documentation
  • Loading branch information
gdavison authored Aug 8, 2024
2 parents d25fdb1 + 6f6b6d4 commit 5791076
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
7 changes: 7 additions & 0 deletions docs/data-handling-and-conversion.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ For example, to include `Tags`, call
diags := flex.Expand(ctx, source, &target, flex.WithNoIgnoredFieldNames())
```

AutoFlex is able to convert single-element lists from Terraform blocks into single struct or pointer values in AWS API structs.

#### Overriding Default Behavior

In some cases, flattening and expanding need conditional handling.
One important case is new AWS API implementations where the input or output structs make use of [union types](https://smithy.io/2.0/spec/aggregate-types.html#union).
The AWS implementation uses an interface as the common type, along with various concrete implementations.
Expand Down Expand Up @@ -369,6 +373,9 @@ func (m configuration) expandToUpdateConfiguration(ctx context.Context) (result
}
```

#### Troubleshooting

AutoFlex can output detailed logging as it flattens or expands a value.
To turn on logging for AutoFlex, use the environment variable `TF_LOG_AWS_AUTOFLEX` to set the logging level.
Valid values are `ERROR`, `WARN`, `INFO`, `DEBUG`, and `TRACE`.
By default, AutoFlex logging is set to `ERROR`.
Expand Down
3 changes: 2 additions & 1 deletion infrastructure/repository/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# repository

Public Terraform configuration for managing the `terraform-provider-aws` code repository, to enable community contributions. Currently only utilized for managing AWS Partition, AWS Service, and workflow labels.
Public Terraform configuration for managing the `terraform-provider-aws` code repository, to enable community contributions.
Currently only used for managing AWS Partition, AWS Service, and workflow labels.

HashiCorp maintainers should utilize the `terraform-repositories` repository for managing more sensitive configuration.
4 changes: 4 additions & 0 deletions infrastructure/repository/labels-workflow.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ variable "workflow_labels" {
color = "844fba", # color:terraform (main)
description = "Pertains to authentication; to the provider itself of otherwise."
},
"autoflex" = {
color = "844fba", # color:terraform (main)
description = "Pertains to AutoFlex."
},
"aws-sdk-go-migration" = {
color = "844fba", # color:terraform (main)
description = "Issues that are related to the providers migration to AWS SDK for Go v2."
Expand Down

0 comments on commit 5791076

Please sign in to comment.