-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathprovider.tf.example
57 lines (47 loc) · 1.76 KB
/
provider.tf.example
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
52
53
54
55
56
57
## AWS provider
# https://registry.terraform.io/providers/hashicorp/aws/latest/docs
# With credentials/region inferred from your shared AWS config
provider "aws" {}
# Credentials and region can also be provided as environment variables for the above block
# export AWS_ACCESS_KEY_ID="anaccesskey"
# export AWS_SECRET_ACCESS_KEY="asecretkey"
# export AWS_REGION="us-west-2"
# With explicit configuration
provider "aws" {
region = "us-west-2"
access_key = "my-access-key"
secret_key = "my-secret-key"
}
# Pointing to a specific profile in your shared AWS config
provider "aws" {
profile = "customprofile"
}
# Pointing to specific shared AWS config and profile
provider "aws" {
shared_config_files = ["/Users/tf_user/.aws/conf"]
shared_credentials_files = ["/Users/tf_user/.aws/creds"]
profile = "customprofile"
}
## Kubernetes provider
# https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/guides/getting-started#provider-setup
# With .kube/config
provider "kubernetes" {
alias = "<<clustername>>"
config_path = "~/.kube/config"
config_context = "<<Your Cluster Context>>"
}
# OR with Certificates
provider "kubernetes" {
alias = "<<clustername>>"
host = "https://<<Your Cluster Host>>"
client_certificate = file("<<cert.pem>>")
client_key = file("<<key.pem>>")
cluster_ca_certificate = file("<<ca-cert.pem>>")
}
# OR with AWS
provider "kubernetes" {
alias = "<<clustername>>"
host = data.aws_eks_cluster.<<Your Cluster>>.endpoint
cluster_ca_certificate = base64decode(data.aws_eks_cluster.<<Your Cluster>>.certificate_authority.0.data)
token = data.aws_eks_cluster_auth.<<Your Cluster>>.token
}