这是indexloc提供的服务,不要输入任何密码
Skip to content

Add Alias resource and Data Source #41

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

Merged
merged 2 commits into from
Jun 7, 2022
Merged

Add Alias resource and Data Source #41

merged 2 commits into from
Jun 7, 2022

Conversation

dglsparsons
Copy link
Collaborator

This is a refactored implementation of #32. Specifically, it tidies up some error handling around the alias resource and standardized the docs a tad more.

It still requires test suites for both the data_source and the resource adding, which I'll look at shortly.

FYI @WCMinor and @raymondbutcher

@WCMinor
Copy link
Contributor

WCMinor commented Jun 6, 2022

I'll wait for you to merge this, then I'll rebase mine and do a further PR with our latest implementation: The deployment datasource. We use it to control the automated deployments:

data "vercel_alias" "prod" {
  team_id = local.vercel_team_id
  alias = local.vercel_production_domain
}

#Get prod deployment info in order to ensure we use the SHA of prod
data "vercel_deployment" "prod" {
  team_id = local.vercel_team_id
  id = data.vercel_alias.prod.deployment_id
  project_id = local.vercel_project_id
}
resource "vercel_deployment" "deployment" {
  team_id           = local.vercel_team_id
  project_id        = local.vercel_project_id
  delete_on_destroy = true
  ref               = data.vercel_deployment.prod.sha
  environment       = local.vercel_envs
}

@dglsparsons
Copy link
Collaborator Author

I'll wait for you to merge this, then I'll rebase mine and do a further PR with our latest implementation: The deployment datasource. We use it to control the automated deployments:

I like the idea of this very much. I think in general wherever a resource exists, it's a good pattern to have a matching data source. So 👏. I'll look forward to seeing your changes there :)

@dglsparsons dglsparsons requested review from craigandrews and ecklf June 6, 2022 15:51
@dglsparsons dglsparsons marked this pull request as ready for review June 6, 2022 15:52
@dglsparsons dglsparsons merged commit eab745f into main Jun 7, 2022
@dglsparsons dglsparsons deleted the resource-alias branch June 7, 2022 16:06
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.

3 participants