https://pulumi.com logo
Title
c

calm-butcher-40899

10/08/2022, 10:09 AM
👋 Hey, do you guys use localstack for testing aws codes? I followed this guide to set up aws provider config for pulumi/aws. However, I always got some ambiguous errors when I run
pulumi up/preview
with the quickstart codes for creating an S3 bucket:
error: could not validate provider configuration: 1 error occurred:
        * Invalid or unknown key
I tried creating a VPC resource and still got this error, which makes me feel there’s provider config issues. But when I use the same config on Terraform, everything works. I will attach in 🧵 my stack config and localstack docker-compose file for reference. Any comments and insights on the issue will be much appreciated!!
localstack docker-compose file:
services:
  localstack:
    container_name: "${LOCALSTACK_DOCKER_NAME-localstack_main}"
    image: localstack/localstack
    ports:
      - "127.0.0.1:4566:4566"            # LocalStack Gateway
      - "127.0.0.1:4510-4559:4510-4559"  # external services port range
      - "127.0.0.1:53:53"                # DNS config (only required for Pro)
      - "127.0.0.1:53:53/udp"            # DNS config (only required for Pro)
      - "127.0.0.1:443:443"              # LocalStack HTTPS Gateway (only required for Pro)
    environment:
      - DEBUG=${DEBUG-}
      - PERSISTENCE=${PERSISTENCE-}
      - LAMBDA_EXECUTOR=${LAMBDA_EXECUTOR-}
      - LOCALSTACK_API_KEY=${LOCALSTACK_API_KEY-}  # only required for Pro
      - DOCKER_HOST=unix:///var/run/docker.sock
    volumes:
      - "${LOCALSTACK_VOLUME_DIR:-./volume}:/var/lib/localstack"
      - "/var/run/docker.sock:/var/run/docker.sock"
b

billowy-army-68599

10/08/2022, 3:38 PM
@calm-butcher-40899 I think it’s because
aws:endpoints
is a list, and you’ve only made the first element in your list a list item: Try adding
-
to every one of your endpoints
c

calm-butcher-40899

10/09/2022, 5:37 AM
thanks man, but from https://www.pulumi.com/registry/packages/aws/api-docs/provider/#providerendpoint it seems the endpoints config should be an array of
ProviderEndpointArgs
object, which consists of key-value pairs of the endpoint config for each service. I also tried adding
-
to each endpoint config and it doesn’t help.
I managed to make it work by only specifying the s3 endpoint in
aws:endpoints
. Then
pulumi up
just works for the quickstart code. I guess there’s some invalid endpoint config under the
aws:endpoints
. But there are around 300 endpoint configs here, it’s difficult to test one by one to find out the bad service with wrong endpoint config.