hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.74k stars 9.1k forks source link

[Bug]: Can't configure a value for "flow_status" on AppFlow Flows #36441

Open geoff-beaven opened 6 months ago

geoff-beaven commented 6 months ago

Terraform Core Version

1.5.0

AWS Provider Version

5.41.0

Affected Resource(s)

aws_appflow_flow

Expected Behavior

AppFlow Flow status should be configurable in the resource block.

Relating to this issue https://github.com/hashicorp/terraform-provider-aws/issues/34574: when an AppFlow Flow is pushed with trigger_type="Scheduled" it was deploying in AWS with a status of "Draft", not "Active" - requiring an additional step either through the UI or API to update the flow to a status of "Active" before the flow could be used.

Actual Behavior

A fix was subsequently implemented on https://github.com/hashicorp/terraform-provider-aws/pull/34948 addressing the original issue.

However, the merged fix appears to have no affect on the behavior - Flows are still deployed in a "Draft" state requiring additional interaction in the UI or API before the flow is useable. The documentation states that a "flow_status" attribute reference is exported, but makes no reference to this field as an argument in the resource block.

Relevant Error/Panic Output Snippet

Error: Value for unconfigurable attribute
│ 
│   with module.appflow_flows.aws_appflow_flow.flow,
│   on main.tf line 31, in resource "aws_appflow_flow" "flow":
│   31:   flow_status = "Active"
│ 
│ Can't configure a value for "flow_status": its value will be decided automatically based on the result of applying this configuration.

Terraform Configuration Files

resource "aws_appflow_flow" "flow" {
  name       = "my-appflow-name"
  flow_status = "Active"
  ...
  trigger_config {
        trigger_type="Scheduled"
        trigger_properties{
            scheduled {
                schedule_expression  = "cron(0 1 * * ? *)"
            }
        }
    }
}

Steps to Reproduce

  1. Deploy resource without a status argument
  2. Observe "Draft" value on the "Flow status" field in UI: image

  3. Deploy resource with flow_status = "Active" status argument
  4. Observe error message:

    Can't configure a value for "flow_status": its value will be decided automatically based on the result of applying this configuration.

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

github-actions[bot] commented 6 months ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

justinretzolk commented 5 months ago

Hey @gbeaven90 👋 Thank you for taking the time to raise this! With the way that flow_status is currently implemented, it is a read-only attribute, which is why you're receiving the error that you are. That said, it's unclear to me how the pull request that you mentioned was intended to fix the larger issue, so I'd like to leave this issue open for further review and prioritization.

Viriathus1 commented 2 months ago

Hey @geoff-beaven I had the same issue and it's a needed fix. Can you 👍 my open pr #37501 which will resolve it?