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

ISSUE-125 | add --skip-validation flag to documentation #132

Merged
merged 2 commits into from
Aug 12, 2022

Conversation

juanmatias
Copy link
Contributor

@juanmatias juanmatias commented Aug 10, 2022

Added --skip-validation to lines in documentation when there is no S3 set yet.

What?

  • Description on whether to add this flag added to these files:
    • docs/first-steps/management-account.md
    • docs/first-steps/security-and-shared-accounts.md
    • docs/user-guide/ref-architecture-aws/tf-state-workflow.md

Why?

References

@juanmatias juanmatias added documentation Improvements or additions to documentation patch labels Aug 10, 2022
@juanmatias juanmatias requested a review from a team as a code owner August 10, 2022 18:02
@rodriguez-matias
Copy link
Contributor

rodriguez-matias commented Aug 10, 2022

Hi @juanmatias !
Im testing the Leverage landing zone and I found a similar issue in the step "Deploy Management/Identity layer".
https://leverage.binbash.com.ar/first-steps/management-account/#identities-layer

image

Maybe we could also inlude the same solution here for this step
management/global/base-identities/
$ leverage terraform init --skip-validation

What do you thing bout it?

Copy link
Contributor

@rodriguez-matias rodriguez-matias left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@exequielrafaela exequielrafaela added this to the 2022 Q3 milestone Aug 10, 2022
@exequielrafaela exequielrafaela requested review from a team August 10, 2022 18:59
@exequielrafaela exequielrafaela changed the title ISSUE-125 add --skip-validation flag to documentation Fix | #125 | add --skip-validation flag to documentation Aug 10, 2022
@exequielrafaela exequielrafaela changed the title Fix | #125 | add --skip-validation flag to documentation Fix | ISSUE-125 | add --skip-validation flag to documentation Aug 10, 2022
@exequielrafaela exequielrafaela changed the title Fix | ISSUE-125 | add --skip-validation flag to documentation ISSUE-125 | add --skip-validation flag to documentation Aug 10, 2022
@juanmatias
Copy link
Contributor Author

juanmatias commented Aug 11, 2022

@rodriguez-matias

The bucket is created under the Terraform Backend Layer creation, so, I think when creating the identities layer the bucket already exists, thus its config.tf file has these lines uncommented:

  backend "s3" {
    key = "management/identities/terraform.tfstate"
  }

If this is true then we don't need to add the flag when creating identities as we did for backend creation. Please, @angelofenoglio, confirm this.

Hi @juanmatias ! Im testing the Leverage landing zone and I found a similar issue in the step "Deploy Management/Identity layer". https://leverage.binbash.com.ar/first-steps/management-account/#identities-layer

image

Maybe we could also inlude the same solution here for this step management/global/base-identities/ $ leverage terraform init --skip-validation

What do you thing bout it?

@angelofenoglio
Copy link
Contributor

Yes, as @juanmatias pointed out, the --skip-validation is only needed when deploying the terraform backend layer for the first time, most other layers, except under special conditions, do not require this. So for the identities layer it is not a requirement.

@rodriguez-matias
Copy link
Contributor

rodriguez-matias commented Aug 11, 2022

@juanmatias , @angelofenoglio ✋ . Yes you both are rigth.
Sorry for not being more clear before.


The issue under the Identity layer its similar but not the same:

The error that I see here appears when I run terrafom init.
Seems related with some validation of the aws credentials profile name

image

the only aws profile that I have so far at this step its the following:

❯ pwd
./.aws/ld
❯ cat credentials
[ld-bootstrap]
aws_access_key_id = XXXXXXXXXXX
aws_secret_access_key = XXXXXXXXXXX

This validation error its solved running $ leverage terraform init --skip-validation

@juanmatias
Copy link
Contributor Author

juanmatias commented Aug 11, 2022

@rodriguez-matias @angelofenoglio
AFAIK this is related to the profiles not having the name format required by the standards (i.e. not starting with ld-management).

Now, the question here is: must we state in the documentation the usage of this flag by default? or instead, should we add a note notifying that if you use non-standardized names you can skip the validation using the flag?

@angelofenoglio
Copy link
Contributor

Oh, now I get what you mean @rodriguez-matias .
In this case the issue comes from the use of a bootstrap profile during the first part of the first steps guide, but is part of a different issue, maybe we should simply drop the bootstrap name for that profile and use the final version right from the beginning.
This would require some modification in the template and in the cli, but I think it would lead to a more consistent design overall. Should we create an issue and discuss it further there?

@juanmatias juanmatias merged commit 392cdcc into master Aug 12, 2022
@juanmatias juanmatias deleted the ISSUE-125-Add_le-init_flag branch August 12, 2022 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation patch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Doc/ update user-guide => Terraform - S3 & DynamoDB for Remote State Storage & Locking section
4 participants