https://pulumi.com logo
#general
Title
# general
l

limited-rainbow-51650

08/29/2019, 6:12 PM
Is there already a Pulumi Typescript component implementation available to set up an S3 static site with a CloudFront CDN in front of it?
w

white-balloon-205

08/29/2019, 8:02 PM
One nice real-world example of this is the infrastructure that serves www.pulumi.com, which is at: https://github.com/pulumi/docs/blob/master/infrastructure/index.ts There are a few additional things in that example (like managing the upload of all the files to S3, etc), but it’s still a pretty simple yet complete example of this.
l

limited-rainbow-51650

08/29/2019, 8:18 PM
In the meantime, I bumped into one of the examples: https://github.com/pulumi/examples/tree/master/aws-ts-static-website Can someone explain me how the exclamation mark works at the end of this line:
let certificateArn: pulumi.Input<string> = config.certificateArn!;
https://github.com/pulumi/examples/blob/1983bd4292265f9628e858b6105b61aaa02bfe4e/aws-ts-static-website/index.ts#L81 I am executing this example without passing a certificateArn config value, but still the certificate is not created.
w

white-balloon-205

08/29/2019, 8:36 PM
Can someone explain me how the exclamation mark works
It just tells TypeScript to change the type from
T | undefined
to
T
- it doesn't actually "do" anything.
I am executing this example without passing a certificateArn config value, but still the certificate is not created.
Hmm - from the code I cannot imagine how that could happen. I just tried locally and when I do not pass in any config for this, the example correctly creates a new certificate for me.
l

limited-rainbow-51650

08/29/2019, 8:51 PM
I overlooked the fact that the certificate was created in a previous pulumi run by CI/CD. As I never saw it passing by on my laptop’s shell, I ended up confused. 🙂