pulumi / pulumi-synced-folder

A Pulumi component that synchronizes a local folder to Amazon S3, Azure Blob Storage, or Google Cloud Storage.
Apache License 2.0
3 stars 3 forks source link

Doesn't work when default AWS provider is disabled #17

Closed pjoe closed 1 year ago

pjoe commented 1 year ago

What happened?

Getting this error:

error: Error: failed to register new resource maintenance-bucket-folder [synced-folder:index:S3BucketFolder]: 2 UNKNOWN: Invoke: Default provider for 'aws' disabled. 'aws:index/getRegion:getRegion' must use an explicit provider.
        at Object.registerResource (/home/pelle/projects/devops/node_modules/@pulumi/runtime/resource.ts:339:27)
        at new Resource (/home/pelle/projects/devops/node_modules/@pulumi/resource.ts:398:13)
        at new ComponentResource (/home/pelle/projects/devops/node_modules/@pulumi/resource.ts:891:9)
        at new S3BucketFolder (/home/pelle/projects/devops/packages/skybox-webportal/node_modules/@pulumi/s3bucketFolder.ts:52:9)

I can't see how this line would work: https://github.com/pulumi/pulumi-synced-folder/blob/v0.10.1/provider/cmd/pulumi-resource-synced-folder/s3-bucket-folder.ts#L39

Expected Behavior

Runs using specified provider without errors, e.g. like this:

  new synced_folder.S3BucketFolder(
    "maintenance-bucket-folder",
    {
      path: path,
      bucketName: bucket.bucket,
      acl: "public-read",
    },
    { providers: { aws: myProvider } }
  );

Steps to reproduce

Running with default AWs provider disabled (in pulumi..yaml):

config:
  aws:region: eu-central-1
  pulumi:disable-default-providers:
    - aws

Output of pulumi about

CLI          
Version      3.55.0
Go Version   go1.20
Go Compiler  gc

Plugins
NAME           VERSION
nodejs         unknown
synced-folder  0.10.1

Host     
OS       ubuntu
Version  22.04
Arch     x86_64

This project is written in nodejs: executable='/usr/bin/node' version='v18.14.0'

Current Stack: skybox-webportal.develop

TYPE                                                 URN
pulumi:pulumi:Stack                                  urn:pulumi:skybox-webportal.develop::skybox-webportal::pulumi:pulumi:Stack::skybox-webportal-skybox-webportal.develop
pulumi:providers:aws                                 urn:pulumi:skybox-webportal.develop::skybox-webportal::pulumi:providers:aws::networkProvider
pulumi:providers:pulumi                              urn:pulumi:skybox-webportal.develop::skybox-webportal::pulumi:providers:pulumi::default
pulumi:providers:aws                                 urn:pulumi:skybox-webportal.develop::skybox-webportal::pulumi:providers:aws::skyboxProvider
pulumi:providers:random                              urn:pulumi:skybox-webportal.develop::skybox-webportal::pulumi:providers:random::default_4_10_0
aws:rds/clusterParameterGroup:ClusterParameterGroup  urn:pulumi:skybox-webportal.develop::skybox-webportal::aws:rds/clusterParameterGroup:ClusterParameterGroup::skybox-db-cluster-param-group
aws:rds/parameterGroup:ParameterGroup                urn:pulumi:skybox-webportal.develop::skybox-webportal::aws:rds/parameterGroup:ParameterGroup::skybox-db-instance-param-group
aws:secretsmanager/secret:Secret                     urn:pulumi:skybox-webportal.develop::skybox-webportal::aws:secretsmanager/secret:Secret::skybox-db-passwd-secret
random:index/randomPassword:RandomPassword           urn:pulumi:skybox-webportal.develop::skybox-webportal::random:index/randomPassword:RandomPassword::skybox-db-passwd
aws:secretsmanager/secretVersion:SecretVersion       urn:pulumi:skybox-webportal.develop::skybox-webportal::aws:secretsmanager/secret:Secret$aws:secretsmanager/secretVersion:SecretVersion::skybox-db-passwd-secret-version
pulumi:pulumi:StackReference                         urn:pulumi:skybox-webportal.develop::skybox-webportal::pulumi:pulumi:StackReference::central-network.develop
aws:rds/subnetGroup:SubnetGroup                      urn:pulumi:skybox-webportal.develop::skybox-webportal::aws:rds/subnetGroup:SubnetGroup::skybox-db-subnet-group
aws:ec2/securityGroup:SecurityGroup                  urn:pulumi:skybox-webportal.develop::skybox-webportal::aws:ec2/securityGroup:SecurityGroup::skybox-db-sg
aws:rds/cluster:Cluster                              urn:pulumi:skybox-webportal.develop::skybox-webportal::aws:rds/cluster:Cluster::skybox-db
aws:rds/clusterInstance:ClusterInstance              urn:pulumi:skybox-webportal.develop::skybox-webportal::aws:rds/cluster:Cluster$aws:rds/clusterInstance:ClusterInstance::skybox-db-instance

Found no pending operations associated with skybox-webportal.develop

Backend        
Name           pelle-rog
URL            s3://github-ci-pulumistate-1pohww1zvicda
User           pelle
Organizations  

Pulumi locates its logs in /tmp by default
warning: Failed to get information about the Pulumi program's dependencies: could not find either /home/pelle/projects/devops/packages/skybox-webportal/yarn.lock or /home/pelle/projects/devops/packages/skybox-webportal/package-lock.json

Additional context

No response

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).

pjoe commented 1 year ago

Finally got around to testing this: seems to work when explicitly specifying provider:

  new synced.S3BucketFolder(
    "my-files",
    {
      bucketName: bucket.bucket,
      path: "./src/www",
      acl: aws.s3.PrivateAcl,
    },
    { provider: myProvider, parent: bucket }
  );

but not if assuming it to inherit from parent:

  new synced.S3BucketFolder(
    "my-files",
    {
      ...
    },
    {parent: bucket }
  );