-
Notifications
You must be signed in to change notification settings - Fork 281
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
Add azuredevops_serviceendpoint_gcp_terraform resource #742
Add azuredevops_serviceendpoint_gcp_terraform resource #742
Conversation
@microsoft-github-policy-service agree |
@microsoft-github-policy-service agree |
0791df8
to
0141408
Compare
@xuzhang3 is there any other work required on my end before this can be reviewed? |
@konturn can you help resolve the conflicts and update to the latest code. We recently upgrade the API from v5/v6 to v7. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@konturn Thanks for your contribution. A few changes requested.
website/docs/r/serviceendpoint_gcp.html.markdown
need to be documented inazuredevops.erb
- Please make sure the acc tests passed.
r.Schema[saSecretHashKey] = saSecretHashSchema | ||
r.Schema["token_uri"] = &schema.Schema{ | ||
Type: schema.TypeString, | ||
Optional: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this property is required, use Required: true,
and if optional use Optional: true,
} | ||
r.Schema["gcp_project_id"] = &schema.Schema{ | ||
Type: schema.TypeString, | ||
Optional: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this property is required, use Required: true,
and if optional use Optional: true,
Sensitive: true, | ||
DiffSuppressFunc: tfhelper.DiffFuncSuppressSecretChanged, | ||
} | ||
saSecretHashKey, saSecretHashSchema := tfhelper.GenerateSecreteMemoSchema("private_key") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hash function has been deprecated, can removed.
|
||
# azuredevops_serviceendpoint_gcp | ||
Manages a GCP service endpoint within Azure DevOps. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GCP extension is not installed by default. Add note which extension need installed before using this resource.
r := genBaseServiceEndpointResource(flattenServiceEndpointGcp, expandServiceEndpointGcp) | ||
r.Schema["client_email"] = &schema.Schema{ | ||
Type: schema.TypeString, | ||
Required: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this property is required, use Required: true,
and if optional use Optional: true,
128b679
to
8cc051d
Compare
…ns, documentation, and removal of deprecated features
8fc8726
to
f0ace9d
Compare
@konturn you need merge/rebase the latest code from https://github.com/microsoft/terraform-provider-azuredevops. And ensure the AccTests passed. |
My bad, thought I had updated--@xuzhang3 I've merged main into my PR branch, and the pipeline is green. |
DefaultFunc: schema.EnvDefaultFunc("AZDO_GCP_SERVICE_CONNECTION_PRIVATE_KEY", nil), | ||
Description: "Private Key for connecting to the endpoint.", | ||
Sensitive: true, | ||
DiffSuppressFunc: tfhelper.DiffFuncSuppressSecretChanged, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be removed, this function is combined with the hash function
azuredevops/internal/service/serviceendpoint/resource_serviceendpoint_gcp_terraform.go
Outdated
Show resolved
Hide resolved
azuredevops/internal/acceptancetests/resource_serviceendpoint_gcp_terraform_test.go
Outdated
Show resolved
Hide resolved
azuredevops/internal/acceptancetests/resource_serviceendpoint_gcp_terraform_test.go
Outdated
Show resolved
Hide resolved
azuredevops/internal/acceptancetests/resource_serviceendpoint_gcp_terraform_test.go
Outdated
Show resolved
Hide resolved
azuredevops/internal/acceptancetests/resource_serviceendpoint_gcp_terraform_test.go
Show resolved
Hide resolved
// ResourceServiceEndpointGcp schema and implementation for gcp service endpoint resource | ||
func ResourceServiceEndpointGcp() *schema.Resource { | ||
r := genBaseServiceEndpointResource(flattenServiceEndpointGcp, expandServiceEndpointGcp) | ||
r.Schema["client_email"] = &schema.Schema{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we simplify the name to email
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could, but I kept it that way since that's what shows up in the ADO GUI and also in the GCP keyfile json.
…ndpoint_gcp_terraform.go Co-authored-by: xuzhang3 <[email protected]>
…gcp_terraform_test.go Co-authored-by: xuzhang3 <[email protected]>
…gcp_terraform_test.go Co-authored-by: xuzhang3 <[email protected]>
…gcp_terraform_test.go Co-authored-by: xuzhang3 <[email protected]>
…gcp_terraform_test.go Co-authored-by: xuzhang3 <[email protected]>
azuredevops/internal/service/serviceendpoint/resource_serviceendpoint_gcp_terraform.go
Outdated
Show resolved
Hide resolved
3f2e129
to
0c27151
Compare
Alrighty, I think that's everything--@xuzhang3 any other changes that need made? |
|
@konturn LGTM |
All Submissions:
What about the current behavior has changed?
Issue Number: 675
This PR adds support for creating a GCP Service Endpoint. This resource is analogous to the one that's being provisioned for AWS in the PR here.
Does this introduce a change to
go.mod
,go.sum
orvendor/
?Does this introduce a breaking change?
Any relevant logs, error output, etc?
(If it’s long, please paste to https://ghostbin.com/ and insert the link here.)
Other information