Error: AuthorizationHeaderMalformed: The authorization header is malformed; the region 'us-east-1' is wrong; expecting 'ap-southeast-1'
# S3 bucket name already used
Error: error creating EC2 Metadata session: AssumeRoleTokenProviderNotSetError: assume role with MFA enabled, but AssumeRoleTokenProvider session option not set.
Run
export AWS_PROFILE=devops or default
___________________
Error refreshing state: InvalidParameter: 1 validation error(s) found.
- minimum field size of 1, GetObjectInput.Bucket.
This means that the TF state from S3 is not yet created. Comment out the code that calls that non-existent S3.
Or during the init. give the bucket name to use as tfstorage.,
## From output.yml
# terraform {
# backend "s3" {
# key = "tfstate"
# region = "ap-southeast-1"
# }
# }
_________________
Error: error creating EC2 Metadata session: AssumeRoleTokenProviderNotSetError: assume role with MFA enabled, but AssumeRoleTokenProvider session option not set.
https://stackoverflow.com/questions/52432717/terraform-unable-to-assume-roles-with-mfa-enabled
As per this article, Terraform doesn't currently support prompting for the MFA token when being ran as it is intended to be ran in a less interactive fashion as much as possible and it would apparently require significant rework of the provider structure to support this interactive provider configuration.
You must use other non-TF commands so that you can enter the MFA.
aws sts get-caller-identity
How to create TFState for new applications
In Diginex. Subfolder specific to the application must be created. And it requires Jenkins to create.
Error creating S3 bucket: AuthorizationHeaderMalformed: The authorization header is malformed; the region 'us-east-1' is wrong; expecting 'ap-southeast-1'
This means the name is already used.
Deleting S3 could take a day or two. Try to use other names or wait for a long long time