Difference between revisions of "Terraform provider: aws"
Jump to navigation
Jump to search
↑ https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/vpc
↑ https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/appautoscaling_target
↑ https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/appautoscaling_policy
↑ https://registry.terraform.io/search/providers?q=aws_ecs_service
Tags: Mobile web edit, Mobile edit |
|||
(24 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
* https://registry.terraform.io/providers/hashicorp/aws/latest/docs | * https://registry.terraform.io/providers/hashicorp/aws/latest/docs | ||
+ | * <code>[[profile]]</code>, <code>[[shared_config_files]]</code>, <code>[[shared_credentials_files]]</code> | ||
+ | == Configuration examples == | ||
+ | {{basic tf aws profile}} | ||
− | provider "aws" { | + | [[provider]] "aws" { |
− | |||
[[region]] = "[[us-east-1]]" | [[region]] = "[[us-east-1]]" | ||
[[profile]] = "your_profile_name" | [[profile]] = "your_profile_name" | ||
} | } | ||
+ | [[provider]] "aws" { | ||
+ | [[version =]] "~> 3.38.0" | ||
+ | [[region]] = "[[us-east-1]]" | ||
+ | [[profile]] = "your_profile_name" | ||
+ | } | ||
provider "aws" { | provider "aws" { | ||
− | region = [[var.]] | + | region = [[var.region]] |
version = ">= 0.13" | version = ">= 0.13" | ||
[[assume_role]] { | [[assume_role]] { | ||
[[role_arn]] = "arn:aws:iam::01234567890:role/role_in_account_b" | [[role_arn]] = "arn:aws:iam::01234567890:role/role_in_account_b" | ||
} | } | ||
− | } | + | } |
+ | Including Tags: | ||
+ | {{tf_aws_provider_tags}} | ||
+ | |||
+ | [[Dynamic Credentials with the AWS Provider]]: | ||
+ | provider "aws" { | ||
+ | [[shared_config_files]] = [var.tfc_aws_dynamic_credentials.default.shared_config_file] | ||
+ | } | ||
+ | |||
+ | == Installing == | ||
+ | Installing hashicorp/aws v4.31.0 | ||
+ | Installing [[hashicorp/]]aws v4.29.0... | ||
+ | [[Installing hashicorp]]/aws v4.28.0... | ||
+ | Installing hashicorp/aws v4.15.1... | ||
+ | Installing hashicorp/aws v3.63.0... | ||
== Resources == | == Resources == | ||
Line 89: | Line 110: | ||
== Errors == | == Errors == | ||
* <code>[[Error: Provider produced inconsistent final plan]]</code> | * <code>[[Error: Provider produced inconsistent final plan]]</code> | ||
+ | * <code>[[Error: error configuring Terraform AWS Provider: no valid credential sources for Terraform AWS Provider found.]]</code> | ||
+ | * <code>[[Error: configuring Terraform AWS Provider: failed to get shared config profile]]</code> | ||
+ | * <code>[[AWS Error: A Profile was specified along with the environment variables "AWS ACCESS KEY ID" and "AWS SECRET ACCESS KEY". The Profile is now used instead of the environment variable credentials.]]</code> | ||
+ | * <code>[[The security token included in the request is invalid]]</code> | ||
+ | |||
+ | == Limitation == | ||
+ | * <code>[[aws account disable-region]]</code> not implemented | ||
== Related terms == | == Related terms == | ||
Line 94: | Line 122: | ||
* [[CloudFormation resource types: (Type:)]] | * [[CloudFormation resource types: (Type:)]] | ||
* [[Terraform S3 backend]]: <code>[[backends.tf]]</code> | * [[Terraform S3 backend]]: <code>[[backends.tf]]</code> | ||
− | |||
* <code>[[providers.tf]]</code> | * <code>[[providers.tf]]</code> | ||
* [[Terraform provider: AWS]] | * [[Terraform provider: AWS]] | ||
Line 110: | Line 137: | ||
== See also == | == See also == | ||
* {{tf aws}} | * {{tf aws}} | ||
− | |||
− | |||
[[Category:Terraform]] | [[Category:Terraform]] | ||
[[Category:AWS]] | [[Category:AWS]] |
Latest revision as of 13:27, 31 January 2025
- https://registry.terraform.io/providers/hashicorp/aws/latest/docs
profile
,shared_config_files
,shared_credentials_files
Contents
Configuration examples[edit]
provider "aws" { profile = "your_profile_name" }
provider "aws" { region = "us-east-1" profile = "your_profile_name" }
provider "aws" { version = "~> 3.38.0" region = "us-east-1" profile = "your_profile_name" }
provider "aws" { region = var.region version = ">= 0.13" assume_role { role_arn = "arn:aws:iam::01234567890:role/role_in_account_b" } }
Including Tags:
# Terraform 0.12 (2019) and later syntax provider "aws" { # ... other configuration ... default_tags { tags = { Environment = "Production" Owner = "Ops" } } }
Dynamic Credentials with the AWS Provider:
provider "aws" { shared_config_files = [var.tfc_aws_dynamic_credentials.default.shared_config_file] }
Installing[edit]
Installing hashicorp/aws v4.31.0 Installing hashicorp/aws v4.29.0... Installing hashicorp/aws v4.28.0... Installing hashicorp/aws v4.15.1... Installing hashicorp/aws v3.63.0...
Resources[edit]
RDS:
S3:
aws_s3_bucket
aws_s3_versioning
aws_s3_bucket_inventory
aws_s3_bucket_lifecycle_configuration
aws_s3control_bucket_lifecycle_configuration
Errors[edit]
Error: Provider produced inconsistent final plan
Error: error configuring Terraform AWS Provider: no valid credential sources for Terraform AWS Provider found.
Error: configuring Terraform AWS Provider: failed to get shared config profile
AWS Error: A Profile was specified along with the environment variables "AWS ACCESS KEY ID" and "AWS SECRET ACCESS KEY". The Profile is now used instead of the environment variable credentials.
The security token included in the request is invalid
Limitation[edit]
aws account disable-region
not implemented
Related terms[edit]
- Data sources:
aws_caller_identity
- CloudFormation resource types: (Type:)
- Terraform S3 backend:
backends.tf
providers.tf
- Terraform provider: AWS
- AWS Control Tower Account Factory for Terraform (AFT)
- Terraform AWS data sources
AWS_DEFAULT_REGION
- Terraform modules
- Terraform provider-level tagging
required_version
Activities / Changelog[edit]
- Terraform AWS Provider Version 4 Upgrade Guide: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/guides/version-4-upgrade
- Terraform AWS provider 4.0: https://www.hashicorp.com/blog/terraform-aws-provider-4-0-refactors-s3-bucket-resource
See also[edit]
- Terraform AWS: provider, resources, modules, data sources, VPC, IAM, Net, EC2, S3, Route53, ACM, CloudWatch, SES, RDS, ECS,
awscc, autoscaling, EKS
Advertising: