Open MattNguyen opened 5 years ago
Hi Matt,
I don't believe that !Ref "AWS::AccountId"
is actually valid CloudFormation syntax. I could totally be wrong, but I think using pseudo parameters would be better in that case. What were the conflicts with the serverless-pseudo-parameters
plugin? I will have to run some tests to figure out what the issue is.
Thanks, Jeremy
I don't believe that !Ref "AWS::AccountId" is actually valid CloudFormation syntax
I see, I was going off of the pseudo parameters docs but wasn't sure how it was supposed to be represented in the serverless.yml file.
What were the conflicts with the serverless-pseudo-parameters plugin?
If I were to use serverless-pseudo-parameters
, like so:
environment:
AccountId: "#{AWS::AccountId}"
Then the variable resolves to the literal string "#{AWS::AccountId}"
in my function.
Hey Jeremy, thanks for making this.
I ran into the same problem as Matt. I ended up using the Serverless Framework Pro deployment profile feature to inject the account ID as a parameter like: ${param: ACCOUNT_ID}
I assigned that to an environment variable and constructed the RDS cluster ARN inside the function code like this:
arn:aws:rds:${REGION}:${ACCOUNT_ID}:cluster:${CLUSTER_ID}
Now I can run sls offline cloudside
and use RDS Aurora Serverless in local dev.
I tried outputting the aurora cluster ARN in the resources section using Fn:Join
to construct but that didn't seem to work. From what I understand the cloudside plugin is looking for Ref
and GetAtt
so thinking the Fn:Join
wasn't getting pulled in.
@MattNguyen did you resolve your issue. i'm getting TypeError: bucketName.charAt is not a function when using "#{AWS::StackName}-my-bucket"
Hi Jeremy,
Appreciate your work on this. I can see this being quite valuable but running into some roadblocks.
I'm attempting to construct an arn for an
AWS::RDS::DbCluster
which is passed to the environment of a lambda function.Originally I was using serverless-pseudo-parameters to return a string like so :
However it appears that serverless-pseudo-parameters + serverless-cloudside-plugin don't play well together.
So I broke out each parameter into a separate env var and constructed the arn in the lambda function:
However the
AccountId
returns<Resource Not Published>
.My questions are: