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

Add UseStateForUnknown plan modifier to attributes that are stable when being updated #44

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 1 commit into from
Jun 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions vercel/resource_deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ terraform to your Deployment.
`,
Attributes: map[string]tfsdk.Attribute{
"domains": {
Description: "A list of all the domains (default domains, staging domains and production domains) that were assigned upon deployment creation.",
Computed: true,
Description: "A list of all the domains (default domains, staging domains and production domains) that were assigned upon deployment creation.",
Computed: true,
PlanModifiers: tfsdk.AttributePlanModifiers{tfsdk.UseStateForUnknown()},
Type: types.ListType{
ElemType: types.StringType,
},
Expand All @@ -62,8 +63,9 @@ terraform to your Deployment.
Type: types.StringType,
},
"id": {
Computed: true,
Type: types.StringType,
Computed: true,
PlanModifiers: tfsdk.AttributePlanModifiers{tfsdk.UseStateForUnknown()},
Type: types.StringType,
},
"path_prefix": {
Description: "If specified then the `path_prefix` will be stripped from the start of file paths as they are uploaded to Vercel. If this is omitted, then any leading `../`s will be stripped.",
Expand All @@ -72,9 +74,10 @@ terraform to your Deployment.
PlanModifiers: tfsdk.AttributePlanModifiers{tfsdk.RequiresReplace()},
},
"url": {
Description: "A unique URL that is automatically generated for a deployment.",
Computed: true,
Type: types.StringType,
Description: "A unique URL that is automatically generated for a deployment.",
Computed: true,
PlanModifiers: tfsdk.AttributePlanModifiers{tfsdk.UseStateForUnknown()},
Type: types.StringType,
},
"production": {
Description: "true if the deployment is a production deployment, meaning production aliases will be assigned.",
Expand Down
10 changes: 5 additions & 5 deletions vercel/resource_dns_record_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,35 +233,35 @@ resource "vercel_dns_record" "a" {
}
resource "vercel_dns_record" "aaaa" {
domain = "%[1]s"
name = "test-acc-%s-aaaa-record"
name = "test-acc-%[2]s-aaaa-record"
type = "AAAA"
ttl = 120
value = "::1"
}
resource "vercel_dns_record" "alias" {
domain = "%[1]s"
name = "test-acc-%s-alias"
name = "test-acc-%[2]s-alias"
type = "ALIAS"
ttl = 120
value = "example.com."
}
resource "vercel_dns_record" "caa" {
domain = "%[1]s"
name = "test-acc-%s-caa"
name = "test-acc-%[2]s-caa"
type = "CAA"
ttl = 120
value = "0 issue \"letsencrypt.org\""
}
resource "vercel_dns_record" "cname" {
domain = "%[1]s"
name = "test-acc-%s-cname"
name = "test-acc-%[2]s-cname"
type = "CNAME"
ttl = 120
value = "example.com."
}
resource "vercel_dns_record" "mx" {
domain = "%[1]s"
name = "test-acc-%s-mx"
name = "test-acc-%[2]s-mx"
type = "MX"
ttl = 120
mx_priority = 123
Expand Down
9 changes: 5 additions & 4 deletions vercel/resource_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,10 @@ For more detailed information, please see the [Vercel documentation](https://ver
Sensitive: true,
},
"id": {
Description: "The ID of the environment variable",
Type: types.StringType,
Computed: true,
Description: "The ID of the environment variable",
Type: types.StringType,
PlanModifiers: tfsdk.AttributePlanModifiers{tfsdk.UseStateForUnknown()},
Computed: true,
},
}, tfsdk.SetNestedAttributesOptions{}),
},
Expand Down Expand Up @@ -156,7 +157,7 @@ For more detailed information, please see the [Vercel documentation](https://ver
"id": {
Computed: true,
Type: types.StringType,
PlanModifiers: tfsdk.AttributePlanModifiers{tfsdk.RequiresReplace()},
PlanModifiers: tfsdk.AttributePlanModifiers{tfsdk.UseStateForUnknown()},
},
"install_command": {
Optional: true,
Expand Down
5 changes: 3 additions & 2 deletions vercel/resource_project_domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ By default, Project Domains will be automatically applied to any ` + "`productio
Description: "The ID of the team the project exists under.",
},
"id": {
Computed: true,
Type: types.StringType,
Computed: true,
PlanModifiers: tfsdk.AttributePlanModifiers{tfsdk.UseStateForUnknown()},
Type: types.StringType,
},
"domain": {
Description: "The domain name to associate with the project.",
Expand Down