Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip IAM/STS validation and metadata check #7874

Merged
merged 3 commits into from
Aug 10, 2016

Conversation

renier
Copy link
Contributor

@renier renier commented Jul 29, 2016

Skip IAM/STS validation and metadata check

  • Skip IAM/STS identity validation - For environments or other api
    implementations where there are no IAM/STS endpoints available, this
    option lets you opt out from that provider initialization step.
  • Skip metdata api check - For environments in which you know ahead of
    time there isn't going to be a metadta api endpoint, this option lets
    you opt out from that check to save time.

Sample provider config:

provider "aws" {
  region = "us-east-1"
  skip_iam_creds_validation = true
  skip_iam_account_id = true
  skip_metadata_api_check = true
}

@iamatypeofwalrus
Copy link

Just saw this PR while looking at references to my own.

Totally agree with the Boolean switch reasoning and happy to close my PR and move forward with this approach.

* Skip IAM/STS identity validation - For environments or other api
  implementations where there are no IAM/STS endpoints available, this
  option lets you opt out from that provider initialization step.
* Skip metdata api check - For environments in which you know ahead of
  time there isn't going to be a metadta api endpoint, this option lets
  you opt out from that check to save time.
@renier renier force-pushed the feature/skip_iam_validation branch from ed98ace to 0f041b5 Compare August 5, 2016 20:27
if c.SkipIamValidation == false {
// These two services need to be set up early so we can check on AccountID
client.iamconn = iam.New(awsIamSess)
client.stsconn = sts.New(sess)
Copy link
Member

@radeksimko radeksimko Aug 9, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would cause Terraform to crash if you tried applying any iam_* resource with SkipIamValidation set to true. Is there any reason why not keep it outside of the conditional block?

@radeksimko
Copy link
Member

radeksimko commented Aug 9, 2016

@renier Thanks for the separation. This really helps us reviewing each feature thoroughly and discuss details and effects more easily.

I left you two comments there that may need addressing.
Otherwise this PR is looking pretty good functional/approach-wise.


I will probably add a few comments to the docs once we merge this - effects to be aware of. e.g.

  • skip_credentials_validation = true doesn't prevent you from managing iam_* resources, but Terraform will still try to reach to the original AWS IAM endpoint which may not be what you want in non-AWS environments
  • skip_requesting_account_id = true prevents you from managing any resource that requires Account ID to construct an ARN, namely
    • aws_db_instance
    • aws_db_option_group
    • aws_db_parameter_group
    • aws_db_security_group
    • aws_db_subnet_group
    • aws_elasticache_cluster
    • aws_glacier_vault
    • aws_rds_cluster
    • aws_rds_cluster_instance
    • aws_rds_cluster_parameter_group
    • aws_redshift_cluster
  • skip_metadata_api_check = true prevents Terraform from authenticating via Metadata API - i.e. you may need to use other auth methods (static credentials set as ENV vars or config)

@radeksimko radeksimko added the waiting-response An issue/pull request is waiting for a response from the community label Aug 9, 2016
@radeksimko radeksimko self-assigned this Aug 9, 2016
@renier
Copy link
Contributor Author

renier commented Aug 10, 2016

@radeksimko Thanks for the review. I don't think this would ever be used against real AWS environments, but I think I addressed all your comments with the iam/sts initialization and increased skip choice resolution.

provider "aws" {
  region = "us-east-1"
  skip_iam_creds_validation = true
  skip_iam_account_id = true
  skip_metadata_api_check = true
}

@radeksimko radeksimko removed the waiting-response An issue/pull request is waiting for a response from the community label Aug 10, 2016
@radeksimko
Copy link
Member

👍

Technically credentials or account ID may not always come from the IAM API (but from metadata API), but that's a really a naming nitpick I'm happy to address in a separate PR.

@ghost
Copy link

ghost commented Apr 23, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants