question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Output collision when deploying a split service into the same bucket

See original GitHub issue

Due to #9313, the name of the bucket where the deployment occurred is being exported by default. If a service is divided into multiple files deploying to the same bucket, the default outputs are gonna conflict with each other.

serverless_A.yml
service: lol

useDotenv: true

provider:
  name: aws
  runtime: dotnetcore3.1
  stage: dev
  stackName: stack-A
  deploymentBucket:
    name: bucket
  deploymentPrefix: prefix

functions:
  FunctionA:
    .....
serverless_B.yml
service: lol

useDotenv: true

provider:
  name: aws
  runtime: dotnetcore3.1
  stage: dev
  stackName: stack-B
  deploymentBucket:
    name: bucket
  deploymentPrefix: prefix

functions:
  FunctionB:
    .....

Installed version

Framework Core: 2.38
Plugin: 4.5.3
SDK: 4.2.2
Components: 3.9.0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:41 (26 by maintainers)

github_iconTop GitHub Comments

7reactions
TMiNuscommented, Apr 23, 2021

The way I read the merge request, I see two ways to accommodate my current use case

  1. Extend the current format sls-{service}-{stage}-{outputName} to include the stackName
  2. Allow disabling certain automatic exports
2reactions
rdemoraiscommented, Jul 22, 2021

Guys,

I’m here because I ran into the same problem. The solution was to manipulate how the outputs was generated. The Serverless.yml end up like that:

resources:
  Outputs:
    ServiceEndpoint:
      Export:
        Name: ${self:service}-${self:provider.stage, 'stage'}-${self:custom.stackName}-ServiceEndpoint
    ModulesLambdaLayerS3Key:
      Export:
        Name: ${self:service}-${self:provider.stage, 'stage'}-${self:custom.stackName}-ModulesLambdaLayerS3Key
    DistributionDomainName:
      Export:
        Name: ${self:service}-${self:provider.stage, 'stage'}-${self:custom.stackName}-DistributionDomainName
    ServerlessDeploymentBucketName:
      Export:
        Name: ${self:service}-${self:provider.stage, 'stage'}-${self:custom.stackName}-ServerlessDeploymentBucketName
    ModulesLambdaLayerHash:
      Export:
        Name: ${self:service}-${self:provider.stage, 'stage'}-${self:custom.stackName}-ModulesLambdaLayerHash
    ModulesLambdaLayerQualifiedArn:
      Export:
        Name: ${self:service}-${self:provider.stage, 'stage'}-${self:custom.stackName}-ModulesLambdaLayerQualifiedArn

Hope it can help someone.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Collision Domain and Broadcast Domain in Computer Network
Every port on a switch is in a different collision domain, i.e a switch is a collision domain separator. So messages that come...
Read more >
class Stack (construct) · AWS CDK
bucket.bucketName) . This will make sure the CloudFormation Export continues to exist while the relationship between the two stacks is being broken. Deploy...
Read more >
Find Answers to AWS Questions about AWS CloudFormation
I am trying to create S3 bucket based on a condition whether the bucket already exists or not. I am trying to use...
Read more >
Hash map without collision check
The goal is to calculate the hash, find bucket and then find the actual value inside the bucket using ONLY the full 256-bit...
Read more >
Packet Transmission Time - an overview | ScienceDirect Topics
In networks in which the propagation delay is small compared to the packet ... it can cause a collision at the receiver of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found