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

azurerm_trusted_signing_account - new resource support #27720

Merged
merged 8 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
3 changes: 3 additions & 0 deletions .github/labeler-issue-triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ service/bots:
service/cdn:
- '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_cdn_((.|\n)*)###'

service/codesigning:
- '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_trusted_signing_account((.|\n)*)###'

service/cognitive-services:
- '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_(ai_services|cognitive_)((.|\n)*)###'

Expand Down
5 changes: 5 additions & 0 deletions .github/labeler-pull-request-triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ service/cdn:
- any-glob-to-any-file:
- internal/services/cdn/**/*

service/codesigning:
- changed-files:
- any-glob-to-any-file:
- internal/services/codesigning/**/*

service/cognitive-services:
- changed-files:
- any-glob-to-any-file:
Expand Down
1 change: 1 addition & 0 deletions .teamcity/components/generated/services.kt
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ var services = mapOf(
"synapse" to "Synapse",
"systemcentervirtualmachinemanager" to "System Center Virtual Machine Manager",
"trafficmanager" to "Traffic Manager",
"codesigning" to "Trusted Signing",
"vmware" to "VMware",
"voiceservices" to "Voice Services",
"web" to "Web",
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ require (
github.com/google/go-cmp v0.6.0
github.com/google/uuid v1.6.0
github.com/hashicorp/go-azure-helpers v0.70.1
github.com/hashicorp/go-azure-sdk/resource-manager v0.20241009.1142232
github.com/hashicorp/go-azure-sdk/sdk v0.20241009.1142232
github.com/hashicorp/go-azure-sdk/resource-manager v0.20241017.1093842
github.com/hashicorp/go-azure-sdk/sdk v0.20241017.1093842
Copy link
Member

Choose a reason for hiding this comment

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

Updating the go-azure-sdk should be done in a separate PR otherwise we end up causing conflicts like has happened here.

github.com/hashicorp/go-hclog v1.6.3
github.com/hashicorp/go-multierror v1.1.1
github.com/hashicorp/go-uuid v1.0.3
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/go-azure-helpers v0.70.1 h1:7hlnRrZobMZxpOzdlNEsayzAayj/KRG4wpDS1jgo4GM=
github.com/hashicorp/go-azure-helpers v0.70.1/go.mod h1:BmbF4JDYXK5sEmFeU5hcn8Br21uElcqLfdQxjatwQKw=
github.com/hashicorp/go-azure-sdk/resource-manager v0.20241009.1142232 h1:LAN6wm2cHFo56ly09tg0jXHioh4ygq3SzDoX+XBsMOU=
github.com/hashicorp/go-azure-sdk/resource-manager v0.20241009.1142232/go.mod h1:Zifz0xUVKdiNCzvp3HTa0CNCueZlxD2tdgqPf2QA3qs=
github.com/hashicorp/go-azure-sdk/sdk v0.20241009.1142232 h1:CxBWfnrsR/Vdyd+4N782xzYoqw5bczBSguwOpiF7VO8=
github.com/hashicorp/go-azure-sdk/sdk v0.20241009.1142232/go.mod h1:dMKF6bXrgGmy1d3pLzkmBpG2JIHgSAV2/OMSCEgyMwE=
github.com/hashicorp/go-azure-sdk/resource-manager v0.20241017.1093842 h1:GRGeerwPZiUHLkujG//JgbsB0gEoE65mnKhzQR9m6pg=
github.com/hashicorp/go-azure-sdk/resource-manager v0.20241017.1093842/go.mod h1:w43bj+jYD+kL5Tp1T+cxgmZjdU5/zjlEZ5A1nwJlEOs=
github.com/hashicorp/go-azure-sdk/sdk v0.20241017.1093842 h1:lqU3vkM+F2F8TrkIGnhLB4H9nBjtLlzkOVMWxZNtio8=
github.com/hashicorp/go-azure-sdk/sdk v0.20241017.1093842/go.mod h1:dMKF6bXrgGmy1d3pLzkmBpG2JIHgSAV2/OMSCEgyMwE=
github.com/hashicorp/go-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU=
github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg=
github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
Expand Down
5 changes: 5 additions & 0 deletions internal/clients/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import (
blueprints "github.com/hashicorp/terraform-provider-azurerm/internal/services/blueprints/client"
bot "github.com/hashicorp/terraform-provider-azurerm/internal/services/bot/client"
cdn "github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn/client"
codesigning "github.com/hashicorp/terraform-provider-azurerm/internal/services/codesigning/client"
cognitiveServices "github.com/hashicorp/terraform-provider-azurerm/internal/services/cognitive/client"
communication "github.com/hashicorp/terraform-provider-azurerm/internal/services/communication/client"
compute "github.com/hashicorp/terraform-provider-azurerm/internal/services/compute/client"
Expand Down Expand Up @@ -174,6 +175,7 @@ type Client struct {
Blueprints *blueprints.Client
Bot *bot.Client
Cdn *cdn.Client
CodeSigning *codesigning.Client
Cognitive *cognitiveServices.Client
Communication *communication.Client
Compute *compute.Client
Expand Down Expand Up @@ -347,6 +349,9 @@ func (client *Client) Build(ctx context.Context, o *common.ClientOptions) error
return fmt.Errorf("building clients for Bot: %+v", err)
}
client.Cdn = cdn.NewClient(o)
if client.CodeSigning, err = codesigning.NewClient(o); err != nil {
return fmt.Errorf("building clients for Code Signing: %+v", err)
}
if client.Cognitive, err = cognitiveServices.NewClient(o); err != nil {
return fmt.Errorf("building clients for Cognitive: %+v", err)
}
Expand Down
2 changes: 2 additions & 0 deletions internal/provider/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/hashicorp/terraform-provider-azurerm/internal/services/blueprints"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/bot"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/codesigning"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/cognitive"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/communication"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/compute"
Expand Down Expand Up @@ -148,6 +149,7 @@ func SupportedTypedServices() []sdk.TypedServiceRegistration {
azurestackhci.Registration{},
batch.Registration{},
bot.Registration{},
codesigning.Registration{},
cognitive.Registration{},
communication.Registration{},
compute.Registration{},
Expand Down
27 changes: 27 additions & 0 deletions internal/services/codesigning/client/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package client

import (
"fmt"

codesigning_v2024_09_30_preview "github.com/hashicorp/go-azure-sdk/resource-manager/codesigning/2024-09-30-preview"

"github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager"
"github.com/hashicorp/terraform-provider-azurerm/internal/common"
)

type Client struct {
V20240930previewClient codesigning_v2024_09_30_preview.Client
magodo marked this conversation as resolved.
Show resolved Hide resolved
}

func NewClient(o *common.ClientOptions) (*Client, error) {
V20240930previewClient, err := codesigning_v2024_09_30_preview.NewClientWithBaseURI(o.Environment.ResourceManager, func(c *resourcemanager.Client) {
o.Configure(c, o.Authorizers.ResourceManager)
})
if err != nil {
return nil, fmt.Errorf("building client for codesigning v20240930preview: %+v", err)
}

return &Client{
V20240930previewClient: *V20240930previewClient,
}, nil
}
40 changes: 40 additions & 0 deletions internal/services/codesigning/registration.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package codesigning

import (
"github.com/hashicorp/terraform-provider-azurerm/internal/sdk"
)

type Registration struct{}

var _ sdk.TypedServiceRegistration = Registration{}

func (r Registration) AssociatedGitHubLabel() string {
return "service/codesigning"
Copy link
Member

Choose a reason for hiding this comment

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

We should probably just call this

Suggested change
return "service/codesigning"
return "service/trustedsigning"

}

// Name is the name of this Service
func (r Registration) Name() string {
return "Trusted Signing"
}

// WebsiteCategories returns a list of categories which can be used for the sidebar
func (r Registration) WebsiteCategories() []string {
return []string{
"Trusted Signing",
}
}

// DataSources returns a list of Data Sources supported by this Service
func (r Registration) DataSources() []sdk.DataSource {
return []sdk.DataSource{}
}

// Resources returns a list of Resources supported by this Service
func (r Registration) Resources() []sdk.Resource {
return []sdk.Resource{
TrustedSigningAccountResource{},
}
}
Loading
Loading