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

create terraform backends from the UI #145

Merged
merged 35 commits into from
Apr 7, 2021
Merged

Conversation

glennmusa
Copy link
Contributor

@glennmusa glennmusa commented Apr 5, 2021

Description

This update changes how the front-end creates the required resources to deploy the MLZ Configuration Resources (the Service Principal and KeyVault(s)) and terraform backend resources (storage accounts and containers. KeyVaults, contributor roles).

To give this a shot, login to a commercial cloud using the AZ CLI and try:

src/scripts/setup_ezdeploy.sh -s {sub_id}

The high points are:

  1. updates setup_ezdeploy.sh to use many more defaults and deploy an operational front-end with just: ./setup_ezdeploy.sh -s {sub_id}

  2. refactors setup_ezdeploy.sh to call multiple files

    • scripts/setup_ezdeploy_local.sh if the docker strategy local is specified
    • scripts/container-registry/create_acr.sh to create new Azure Container Registry instances from an mlz_tf_cfg.var
    • scripts/container-registry/deploy_instance.sh to deploy a container into the new ACR
    • scripts/container-registry/add_auth_scopes.sh to add User.Read permissions for the container in the ACR
  3. introduces scripts/config/generate_config_file.sh as a way to consistently create new mlz_tf_cfg.var files to drive deployments from the shell or UI and allows for setting defaults (like, say, a user doesn't specify a T0 subscription id, it will default to the configuration subscription ID)

  4. updates the front end to use defaults for user-supplied values for Hub through Tier 2

  5. introduces a new means of gathering user input instead of get_opts:

    • this allows a user to specify the arguments in any order and with longer, more-descriptive names if needed
  6. adds checkfordocker.sh to check for tooling requirements

Issue reference

The issue this PR will close: #140

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles or validates correctly
  • BASH scripts have been validated using shellcheck
  • All tests pass (manual and automated)
  • The documentation is updated to cover any new or changed features
  • Markdown files have been linted using the recommended linter. (See .vscode/extensions.json.)
  • Relevant issues are linked to this PR

@glennmusa glennmusa changed the title Create terraform backends from the UI create terraform backends from the UI Apr 5, 2021
Copy link
Contributor

@Breanna-Stryker Breanna-Stryker left a comment

Choose a reason for hiding this comment

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

Awesome refactor, this looks great and is far more maintainable.

@glennmusa glennmusa merged commit 4ef1f1f into main Apr 7, 2021
@glennmusa glennmusa deleted the glennmusa/setuptfstateforui branch April 7, 2021 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create TF state resources when bootstrapping resources for the UI
3 participants