Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get the Cert ARN in order to reuse it later #4

Closed
Vad1mo opened this issue Nov 9, 2018 · 5 comments
Closed

How to get the Cert ARN in order to reuse it later #4

Vad1mo opened this issue Nov 9, 2018 · 5 comments

Comments

@Vad1mo
Copy link

Vad1mo commented Nov 9, 2018

I need to get the ARN of the Generated Cert. I see it in the console but I would like to be able to feed the ARN into AWS::CloudFront::Distribution

Is there a way how this can be looked up?

@Vad1mo
Copy link
Author

Vad1mo commented Nov 9, 2018

Maybe on the CLI the ARN should be printed out even if you rerun the create-cert, right now it is only displayed once.

@Vad1mo
Copy link
Author

Vad1mo commented Nov 9, 2018

If it is not possible to reference the arn from the plugin in the serverless.yml, then there could be a new command added
eg. sls write-cert-info. This command would then write a ymlto disk cert-info.ymlwith that content

acm-cert-arn: arn:aws:acm:us-east-1:16dxxxxxxx

Then in the serverless.yml this coulld be referenced as follows

AcmCertificateArn: ${file(../cert-info.yml):acm-cert-arn} 

https://serverless.com/framework/docs/providers/aws/guide/variables/#reference-variables-in-other-files

@schwamster
Copy link
Owner

schwamster commented Nov 9, 2018

This might not be the optimal format, but one thing that works out of the box is:

serverless info > cert-info

You will have to parse the file, but that can help you move on.
I can see if I can add some of your other suggestions next week. If urgent feel free to create a pr

@Vad1mo
Copy link
Author

Vad1mo commented Nov 9, 2018

Thx for the tip, this is a good workaround.

sls deploy --acm-cert-arn $(serverless info | grep -o -E "(arn:aws:acm:.+?\s\B)")

schwamster added a commit that referenced this issue Dec 7, 2018
ther arn of the certificate is now also written to the console even if it has already been created
@schwamster
Copy link
Owner

finally got around to implement your suggestions. you can now add a setting to the plugin configuration in serverless.yml "writeCertInfoToFile". If set to true a file called cert-info.yml will be created, default is false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants