https://pulumi.com logo
#general
Title
# general
c

cold-coat-35200

05/06/2019, 11:48 AM
hi, I have a weird issue with ignoreChanges, there's a resource in a ComponentResource class:
Copy code
const vpc = new aws.ec2.Vpc(
      vpcName,
      {
        cidrBlock: cidrBlock,
        enableDnsHostnames: true,
        enableDnsSupport: true,
        tags: Object.assign(
          {
            Name: vpcName
          },
          args.resourceTags
        )
      },
      { parent: this }
    )
if I change this to
Copy code
const vpc = new aws.ec2.Vpc(
      vpcName,
      {
        cidrBlock: cidrBlock,
        enableDnsHostnames: true,
        enableDnsSupport: true,
        tags: {
          Name: vpcName
        }
      },
      { parent: this, ignoreChanges: ['tags'] }
    )
and trying to update the stack, I got an error:
Copy code
aws:ec2:Vpc (dlv-sbx-vpc):
    error: aws:ec2/vpc:Vpc resource 'dlv-sbx-vpc' has a problem: tags (kubernetes): '' expected type 'string', got unconvertible type 'map[string]interface {}'
 
  pulumi:pulumi:Stack (dliver-dlv-sbx):
    error: Running program '/home/ncsibra/dev/prmrgt-infra/pulumi/dliver' failed with an unhandled exception:
    Error: invocation of aws:ec2/getVpc:getVpc returned an error: transport is closing
        at monitor.invoke (/home/ncsibra/dev/prmrgt-infra/pulumi/node_modules/@pulumi/pulumi/runtime/invoke.js:74:33)
        at Object.onReceiveStatus (/home/ncsibra/dev/prmrgt-infra/pulumi/node_modules/grpc/src/client_interceptors.js:1205:9)
        at InterceptingListener._callNext (/home/ncsibra/dev/prmrgt-infra/pulumi/node_modules/grpc/src/client_interceptors.js:568:42)
        at InterceptingListener.onReceiveStatus (/home/ncsibra/dev/prmrgt-infra/pulumi/node_modules/grpc/src/client_interceptors.js:618:8)
        at callback (/home/ncsibra/dev/prmrgt-infra/pulumi/node_modules/grpc/src/client_interceptors.js:845:24)
This resource has a tag, added by EKS, something like
<http://kubernetes.io/cluster/dlv-sbx-cluster-eks-197239a|kubernetes.io/cluster/dlv-sbx-cluster-eks-197239a>: shared
, this tag not exist in pulumi code, because vpc created first, then EKS, so unable to add it from pulumi, but after a refresh, pulumi tries to remove that, but that would cause problems with resources handled by kubernetes. So I tried to add ignoreChanges, but looks like it want to do something with the tags anyway and unable to parse it.
c

creamy-potato-29402

05/06/2019, 6:19 PM
mmm I forget who led this work. Was it @bitter-oil-46081?
b

bitter-oil-46081

05/06/2019, 6:19 PM
It was @white-balloon-205.
w

white-balloon-205

05/06/2019, 6:21 PM
@cold-coat-35200 Could you open an issue in https://github.com/pulumi/pulumi-aws? I'll look into it.
c

cold-coat-35200

05/06/2019, 7:59 PM
done, https://github.com/pulumi/pulumi-aws/issues/553, thanks @white-balloon-205