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

Error pushing stack with AppFlow resources #2211

Closed
julioxavierr opened this issue Nov 10, 2022 · 7 comments
Closed

Error pushing stack with AppFlow resources #2211

julioxavierr opened this issue Nov 10, 2022 · 7 comments
Labels
awaiting-upstream The issue cannot be resolved without action in another repository (may be owned by Pulumi). kind/bug Some behavior is incorrect or out of spec

Comments

@julioxavierr
Copy link

What happened?

When updating a stack, even though there are no updates to the flow arguments, it tries to update it and errors.

Steps to reproduce

  1. Push a stack with a flow
  2. Update the stack

Sample code

new aws.appflow.Flow("import-account", {
  sourceFlowConfig: {
    connectorType: "Salesforce",
    connectorProfileName: connectorName,
    sourceConnectorProperties: {
      salesforce: {
        object: "Account",
      },
    },
  },
  destinationFlowConfigs: [
    {
      connectorType: "S3",
      destinationConnectorProperties: {
        s3: {
          bucketName: bucketPolicy.bucket,
          s3OutputFormatConfig: {
            prefixConfig: {
              prefixType: "PATH",
            },
            aggregationConfig: {
              aggregationType: "None",
            },
            fileType: "JSON",
          },
        },
      },
    },
  ],
  tasks: [
    {
      sourceFields: ["Id", "Name"],
      taskType: "Filter",
      connectorOperators: [
        {
          salesforce: "PROJECTION",
        },
      ],
    },
    {
      sourceFields: ["Id"],
      destinationField: "Id",
      taskType: "Map",
      connectorOperators: [
        {
          salesforce: "NO_OP",
        },
      ],
    },
    {
      sourceFields: ["Name"],
      destinationField: "Name",
      taskType: "Map",
      connectorOperators: [
        {
          salesforce: "NO_OP",
        },
      ],
    },
  ],
  triggerConfig: {
    triggerType: "OnDemand",
  },
});

Expected Behavior

Updating a stack (with pulumi up) that has a flow configured should not try to update the flow if there are no updates.

Actual Behavior

When updating a stack, even though there are no updates to the flow arguments, it tries to update it and fails with the following error:

missing required field, UpdateFlowInput.Tasks[0].SourceFields
missing required field, UpdateFlowInput.Tasks[0].TaskType

In the "details", it's possible to notice that it completely removes the "tasks" field from the CloudFormation resources. So my first guess is that there's a building error.

Output of pulumi about

CLI          
Version      3.46.1
Go Version   go1.19.2
Go Compiler  gc

Plugins
NAME    VERSION
aws     5.19.0
docker  3.5.0
nodejs  unknown

Host     
OS       darwin
Version  13.0
Arch     arm64

This project is written in nodejs: executable='/Users/julioxavierr/.nvm/versions/node/v16.15.0/bin/node' version='v16.15.0'

Current Stack: prod

TYPE                                               URN
pulumi:pulumi:Stack                                urn:pulumi:prod::playground::pulumi:pulumi:Stack::playground-prod
pkg:index:AppFlowBucket                            urn:pulumi:prod::playground::pkg:index:AppFlowBucket::playground-prod-appflow-data
pkg:index:ImportFlow                               urn:pulumi:prod::playground::pkg:index:ImportFlow::playground-prod-account-flow
pkg:index:ImportFunction                           urn:pulumi:prod::playground::pkg:index:ImportFunction::playground-prod-handler
pulumi:providers:aws                               urn:pulumi:prod::playground::pulumi:providers:aws::default_5_19_0
awsx:ecr:Repository                                urn:pulumi:prod::playground::pkg:index:ImportFunction$awsx:ecr:Repository::playground-prod-handler-image
aws:iam/role:Role                                  urn:pulumi:prod::playground::pkg:index:ImportFunction$aws:iam/role:Role::playground-prod-handler-role
aws:s3/bucket:Bucket                               urn:pulumi:prod::playground::pkg:index:AppFlowBucket$aws:s3/bucket:Bucket::playground-prod-appflow-data
aws:ecr/repository:Repository                      urn:pulumi:prod::playground::pkg:index:ImportFunction$awsx:ecr:Repository$aws:ecr/repository:Repository::playground-prod-handler-image
aws:iam/rolePolicyAttachment:RolePolicyAttachment  urn:pulumi:prod::playground::pkg:index:ImportFunction$aws:iam/rolePolicyAttachment:RolePolicyAttachment::playground-prod-handler-s3-role-attach
aws:iam/rolePolicyAttachment:RolePolicyAttachment  urn:pulumi:prod::playground::pkg:index:ImportFunction$aws:iam/rolePolicyAttachment:RolePolicyAttachment::playground-prod-handler-lambda-role-attach
aws:s3:BucketEventSubscription                     urn:pulumi:prod::playground::pkg:index:AppFlowBucket$aws:s3/bucket:Bucket$aws:s3:BucketEventSubscription::playground-prod-object-created-subscription
aws:s3/bucketPolicy:BucketPolicy                   urn:pulumi:prod::playground::pkg:index:AppFlowBucket$aws:s3/bucketPolicy:BucketPolicy::playground-prod-appflow-data-bucket-policy
aws:ecr/lifecyclePolicy:LifecyclePolicy            urn:pulumi:prod::playground::pkg:index:ImportFunction$awsx:ecr:Repository$aws:ecr/lifecyclePolicy:LifecyclePolicy::playground-prod-handler-image
aws:appflow/flow:Flow                              urn:pulumi:prod::playground::pkg:index:ImportFlow$aws:appflow/flow:Flow::playground-prod-account-flow
aws:lambda/function:Function                       urn:pulumi:prod::playground::pkg:index:ImportFunction$aws:lambda/function:Function::playground-prod-handler
aws:lambda/permission:Permission                   urn:pulumi:prod::playground::pkg:index:AppFlowBucket$aws:s3/bucket:Bucket$aws:s3:BucketEventSubscription$aws:lambda/permission:Permission::playground-prod-object-created-subscription
aws:s3/bucketNotification:BucketNotification       urn:pulumi:prod::playground::pkg:index:AppFlowBucket$aws:s3/bucket:Bucket$aws:s3/bucketNotification:BucketNotification::playground-prod-object-created-subscription


Found no pending operations associated with prod

Backend        
Name           pulumi.com

Dependencies:
NAME            VERSION
@pulumi/aws     5.19.0
@pulumi/awsx    0.40.1
@pulumi/pulumi  3.46.0
dotenv          16.0.3
@types/node     18.11.9

Additional context

In the "details", it's possible to notice that it completely removes the "tasks" field from the CloudFormation resources. So my first guess is that there's a building error.

It also seems similar to hashicorp/terraform-provider-aws#25095.

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@julioxavierr julioxavierr added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Nov 10, 2022
@julioxavierr
Copy link
Author

In case anyone struggles with this issue in the future, I was able to workaround it using ReplaceOnChanges

@kpitzen
Copy link
Contributor

kpitzen commented Nov 11, 2022

Hey @julioxavierr - thank you for opening this issue! I think your intuition is correct, and that this is related to the terraform-provider-aws issue you've linked. Given that, I'm going to transfer this to our pulumi-aws provider repo. Thanks again!

@kpitzen kpitzen transferred this issue from pulumi/pulumi Nov 11, 2022
@lblackstone
Copy link
Member

This error appears to be related to this upstream issue: hashicorp/terraform-provider-aws#25095

@lblackstone lblackstone added awaiting-upstream The issue cannot be resolved without action in another repository (may be owned by Pulumi). and removed needs-triage Needs attention from the triage team labels Nov 11, 2022
@aarushisoni
Copy link

Hi! I would like to contribute to this issue. Kindly guide

@lblackstone
Copy link
Member

Hi! I would like to contribute to this issue. Kindly guide

We're waiting on an upstream fix for this, and it looks like someone may have already started work on that fix.

@tusharpandit18
Copy link

I am facing this issue as well

Terraform v1.5.7
on darwin_amd64

provider registry.terraform.io/hashicorp/aws v5.26.0
provider registry.terraform.io/hashicorp/template v2.2.0

@mikhailshilkov
Copy link
Member

The upstream issue hashicorp/terraform-provider-aws#25095 has been resolved as fixed, so I'll close this issue too. Please report a new issue if the problem occurs again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-upstream The issue cannot be resolved without action in another repository (may be owned by Pulumi). kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

6 participants