AWS CloudFormation Resources

Some of the resources, which you can create. Resource must have a type of this format, so you saw S3::Bucket. So first is ProductIdentifier, and then the ResourceType. By going on the link where it says "all resource types," you can see what the resource types are supported. In most of the cases, the ProductIdentifier would be the AWS service, and then the ResourceType would be S3 or EC2, or something like that.

Some of the resources such as S3, they have very little defaults. For example, we didn't provide any defaults. Of course, you can do that, but they're optional. Other resources, such as EC2, they would require more properties, more parameters, such as image ID. If you do not provide those parameters, either when you create a stack or when you create a blueprint, then sorry, it's not gonna work. You can get the real property value from the Ref function. So there is a Ref function, and you can use that function, and there are a few other functions as well, in the resources property to get some of the values. And that would be dynamically, basically, you, instead of hard coding the values, you can get them, because those values might not be available when you actually write the blueprint. They would be available only when you provision this infrastructure from a blueprint.

How many of you remember the lab in which we hosted, a simple static webpage on S3? It was in the AWS Introduction course. So this is the S3 Bucket that will deploy. It will provision a bucket, and then it will enable the HTTP access, and it will configure the static HTTP web server to serve index.html. All is done in a declarative style.

You would define Resource, then the name of the bucket, which is HelloBucket. Probably not a good choice of the name, because it must be globally unique, so you might get an error. If you get an error trying to run it, just make the name unique. Instead of HelloBucket, add HelloBucket123. Website configuration, that's where you would configure what files are root files. For example, index.html would be served if there is no filenames provided.