Is there already a Pulumi Typescript component imp...
# general
l
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
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
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
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
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. 🙂