Using the AWS Provider Flashcards

1
Q

What is CloudFormation?

A

The native tool within AWS to work with Infrastructure as Code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What language formats does Terraform vs CloudFormation support?

A

Terraform: HCL
CloudFormation: JSON and YAML

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does HCL stand for?

A

HashiCorp Configuration Language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How does HCL relate to JSON?

A

HCL is kind of an abstraction from JSON.

ps. We could technically write our Terraform in raw JSON but it’s not recommended.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the values that you give the template to use called in Terraform vs CloudFormation?

A

Terraform: Variables
CloudFormation: Parameters

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the local values that are computed within a template and can be reused throughout the configuration called in Terraform vs CloudFormation?

A

Terraform: Local Variables
CloudFormation: Mapping

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do we process and make a decision based on a logic in Terraform vs CloudFormation?

A

Terraform: Logical Operators
CloudFormation: Conditions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are AWS resources represented by in Terraform vs CloudFormation?

A

Terraform: Resources
CloudFormation: Resources

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the reusable pieces of logic/code that are used to either manipulate values or refer to other values within the configuration in Terraform vs CloudFormation?

A

Terraform: Functions
CloudFormation: Intrinsic Functions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

If you want to use an existing stack to augment the stack we’re creating, what do we use in Terraform vs CloudFormation?

A

Terraform: Modules
CloudFormation: Nested Stacks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How do the concepts of dependency compare between Terraform vs CloudFormation?

A

Terraform: Automatic Dependency
CloudFormation: Implicit Dependency

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does Terraform and CloudFormation have in common when working out dependencies and what resources to create first?

A

They both create a dependency graph when we’re running a plan, and if they see a dependency between resources, they will create the resource that the other one is dependent on first.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are providers in Terraform?

A

Providers are what Terraform uses to communicate with all the different cloud services and other pieces of software that are out there.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What does the fact that Terraform providers are versioned mean practically?

A

When a new version of a provider comes out, we can wait on that version by specifying the version we want to use in our configuration.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are the two major “thing”s we can find in Terraform providers?

A
  1. Data Sources

2. Resources

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are the data sources used for when using a Terraform provider?

A

Data sources are what we use in Terraform providers to get information out of a provider. They allow us to query for data sources and then use those data sources to create resources.

17
Q

What are resources in the context of a Terraform provider?

A

Resources are the main feature one uses in most providers because we’re here to create infrastructure and infrastructure is really just a collection of resources.

18
Q

What are modules in the context of a Terraform provider?

A

Modules are what we use when we want to use an existing stack to augment the stack we’re creating. These are available in Terraform registry but we can also create our own.

ps. Some of the modules that are available to us through the Terraform registry are actually maintained or at least verified by AWS and HashiCorp. We know that these are fit for use.

19
Q

How does authentication fit into Terraform providers?

A

Terraform providers usually have some form of authentication build into them. This determines how we communicate and authenticate with the API endpoint of a provider.

ps. In the case of AWS, we authenticate against IAM.

20
Q

What are the different ways of authentication with the AWS provider?

A
  1. Static Credentials
  2. Environmental Variables
  3. AWS CLI / Shared Credentials File
  4. Instance Profile
21
Q

What do static credentials mean in the context of authenticating with the AWS provider?

A

Static credentials mean that our access key and the secret key are hardcoded into the Terraform configuration.

ps. It goes without saying that this isn’t recommended, but it is an option that one could choose.

22
Q

How can environmental variables be used when authenticating with the AWS provider?

A

We can set certain environmental variables and the Terraform provider will find those variables and use them for authentication.

23
Q

How does authentication with AWS CLI and shared credentials file work within the AWS provider?

A

We can use the AWS CLI to create a shared credentials file. That shared credentials file typically lives in our user directory in a subdirectory called .aws — We can have multiple profiles within that shared credentials file.

24
Q

What do instance profiles mean in the context of authenticating with the AWS provider?

A

Instance profiles are a way for a resource in AWS to assume a role from IAM and that gives it permission to do certain things within the account or across accounts.

25
Q

When are instance profiles typically used when authenticating with AWS from Terraform?

A

Automation situations where your Terraform commands will be running from EC2 instance or container within AWS.