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.62k stars 9k forks source link

[Bug]: Projection and Map Task types in Terraform appflow not working #34482

Closed tusharpandit18 closed 5 months ago

tusharpandit18 commented 7 months ago

Terraform Core Version

1.5.7

AWS Provider Version

5.26.0

Affected Resource(s)

AWS Appflow

Expected Behavior

Hi,

I am trying to find some documentation for the different task types AppFlow can have The aws documentation doesnt provide enough details https://docs.aws.amazon.com/appflow/1.0/APIReference/API_Task.html

I am trying to use the Map task type, when I use

  task {
    task_type = "Map"
    source_fields = ["id"]
    destination_field = "id"
  }

  task {
    task_type = "Map"
    source_fields = ["name"]
    destination_field = "name"
  }

I get a terraform error of

zr-dev at 11/20/2023 9:45:09 AM: ERROR: CREATING APPFLOW FLOW (LEAD): VALIDATIONEXCEPTION: CREATE FLOW REQUEST FAILED: [TASK VALIDATION ERROR: YOU MUST SPECIFY A PROJECTION TASK OR A MAP_ALL TASK] (16 LINES)

and when I use Projection (which is not even a task type in the aws documentation), I get

  task {
    task_type = "Projection"
    source_fields = ["id", "name"]
  }

  task {
    task_type = "Map"
    source_fields = ["id"]
    destination_field = "id"
  }

  task {
    task_type = "Map"
    source_fields = ["name"]
    destination_field = "name"
  }
│ Error: reading AppFlow Connector Profile (arn:aws:appflow:us-west-2:734371315114:connectorprofile/salesforce-connector-profile): AccessDeniedException: User: arn:aws:sts::734371315114:assumed-role/developers/tusharp@ziprecruiter.com is not authorized to perform: appflow:DescribeConnectorProfiles on resource: arn:aws:appflow:us-west-2:734371315114:connectorprofile/*
│ 
│   with aws_appflow_connector_profile.salesforce-connector-profile,
│   on appflow.tf line 6, in resource "aws_appflow_connector_profile" "salesforce-connector-profile":
│    6: resource "aws_appflow_connector_profile" "salesforce-connector-profile" {
│ 
╵
[ERROR] terraform exited with code 1
infra-global|tusharp-EMP-11927-appflow-terraform-import-flow ⇒ zr-terraform plan -e zr-dev                                      
╷
│ Error: expected task.2.task_type to be one of ["Arithmetic" "Filter" "Map" "Map_all" "Mask" "Merge" "Passthrough" "Truncate" "Validate" "Partition"], got Projection
│ 
│   with aws_appflow_flow.lead,
│   on lead.tf line 1, in resource "aws_appflow_flow" "lead":
│    1: resource "aws_appflow_flow" "lead" {``` 

Terraform Configuration Files

  task {
    task_type = "Projection"
    source_fields = ["id", "name"]
  }

  task {
    task_type = "Map"
    source_fields = ["id"]
    destination_field = "id"
  }

  task {
    task_type = "Map"
    source_fields = ["name"]
    destination_field = "name"
  }

Steps to Reproduce

terraform plan

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 7 months ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

justinretzolk commented 5 months ago

Hey @tusharpandit18 👋 Thank you for taking the time to raise this! In this case, it looks like the AWS API is expecting you to either pass Map_all as the value of the task_type argument, or use PROJECTION as the value of one of the connector_operator fields.

If that doesn't work, and since this is more of a usage question, we'd ask that you ask in one of the Community Resources, such as the AWS Provider forum. We use Issues in this repository to track feature enhancements and bugs in the AWS Provider itself. So that we can maintain focus on that, we ask that broader questions are directed that way. With that in mind, I'm going to close this issue.

github-actions[bot] commented 4 months ago

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.