forked from newrelic/FY23SKO-OaC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
providers.tf
51 lines (44 loc) · 2.1 KB
/
providers.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Here we configure Terraform to use the New Relic and AWS provider.
# We've already configured the right configuration for this workshop, so no changes are needed.
# When working with customers you can find the instructions for this on the Terraform registry:
# New Relic: https://registry.terraform.io/providers/newrelic/newrelic/latest/docs/guides/provider_configuration
# AWS: https://registry.terraform.io/providers/hashicorp/aws/latest/docs
terraform {
# We can define which is the minimum version of Terraform to have installed locally
required_version = "~> 1.1"
required_providers {
# Here we define which version of the New Relic provider we want to use
# This allows customers to fix to a certain version of the provider
# giving them more control when to upgrade as some versions might contain
# breaking changes. In general the Observability as code team tries to
# avoid this, but it does happen. Advise your customers always to use
# the latest version
newrelic = {
source = "newrelic/newrelic"
version = "~> 2.40.0"
}
# We now do the same for AWS
aws = {
source = "hashicorp/aws"
version = "~> 4.5"
}
# Terraform also provides some handy providers, this one we use to generate random strings
random = {
source = "hashicorp/random"
version = "~> 3.1"
}
}
}
# After we've downloaded the latest version of the New Relic provider, we need to
# configure it with the right API keys. Although we have the option to do it here
# directly that's considered a bad practice. Because Terraform files are usually
# added to a source control system like Git, it could mean that credentials become
# exposed to anyone that has access to that system. So we just say that we want to
# use New Relic and AWS.
provider "newrelic" { }
provider "aws" {
region = var.AWS_REGION
}
# Go back to the `Part_1-Setting_up_Terraform.md` readme
# once you think you're done with this file and learn how to set up your
# authentication credentials