sst / ion

SST v3
https://sst.dev
MIT License
1.45k stars 189 forks source link

Cluster and load balancer name are not getting applied via transform #633

Closed imdkbj closed 1 month ago

imdkbj commented 2 months ago

Cluster

Expected : dev-cluster Actual : abc-dev-FargateCluster

    // Create an ECS cluster
    const cluster = new sst.aws.Cluster("Fargate", {
      vpc,
      transform: {
        cluster: {
          name: `${_stage}-cluster`,
          settings: [
            {
              name: "containerInsights",
              value: "enabled"
            }
          ]
        }
      }
    });

LB Expected : dev-abc Actual : dev-AbcTask


 transform: {
        loadBalancer: {
          name:`${_stage}-${_name}`;
        },
      }
jayair commented 2 months ago

Hmm it's strange that dev-cluster is turning into abc-dev-FargateCluster. I might be missing something but what is abc here?

imdkbj commented 2 months ago

Hey, Thaks for the reply and sorry fot not putting the same. abc is the app name here.

imdkbj commented 1 month ago

Ah! Same naming issue found for lambda too. CognitoUserPool too.

image
shmuli9 commented 1 month ago

I have noticed a similar issue for Postgres resource, where the cluster/instance identifier is not being set

  const db =
    new sst.aws.Postgres("DB", {
      databaseName,
      transform: {
        instance: {
          publiclyAccessible: true,
          identifier: "app-staging-db-instance",
        },
        cluster: {
          clusterIdentifier: "app-staging-db-cluster",
        },
      },
    });

But in AWS Console, the identifier is showiing as app-main-dbcluster where main is the name of the stage

shmuli9 commented 1 month ago

I believe this codeblock is the issue

@fwang Why are these values overridden in this way?

fwang commented 1 month ago

@shmuli9 i was just dumb

Fixed in v0.1.44.

shmuli9 commented 1 month ago

@fwang, thanks bro. Appreciate you maintaining this project