Skip to content

Commit

Permalink
Merge pull request #24561 from hashicorp/deps/bump-go-azure-sdk-and-h…
Browse files Browse the repository at this point in the history
…elpers

dependencies: bump `go-azure-sdk` to `v0.20240118.1175416` and `go-azure-helpers` to `v.0.66.1`
  • Loading branch information
tombuildsstuff authored Jan 19, 2024
2 parents db18694 + b0654c7 commit fef23e4
Show file tree
Hide file tree
Showing 1,477 changed files with 4,777 additions and 4,477 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ require (
github.com/golang-jwt/jwt/v4 v4.5.0
github.com/google/go-cmp v0.5.9
github.com/google/uuid v1.3.1
github.com/hashicorp/go-azure-helpers v0.65.1
github.com/hashicorp/go-azure-sdk v0.20240117.1163544
github.com/hashicorp/go-azure-helpers v0.66.1
github.com/hashicorp/go-azure-sdk v0.20240118.1175416
github.com/hashicorp/go-hclog v1.5.0
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 @@ -112,10 +112,10 @@ github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brv
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/go-azure-helpers v0.12.0/go.mod h1:Zc3v4DNeX6PDdy7NljlYpnrdac1++qNW0I4U+ofGwpg=
github.com/hashicorp/go-azure-helpers v0.65.1 h1:MLfd6MqCthMbop4N7OKsF8qn61Pe3Vyw30LjEEJkW5Q=
github.com/hashicorp/go-azure-helpers v0.65.1/go.mod h1:kJxXrFtJKJdOEqvad8pllAe7dhP4DbN8J6sqFZe47+4=
github.com/hashicorp/go-azure-sdk v0.20240117.1163544 h1:af8d6M+NESF60ZOT6RAPU5KqndAWIhAeiDM8RB6qvdM=
github.com/hashicorp/go-azure-sdk v0.20240117.1163544/go.mod h1:txHCdAIIyuDyQdPHgztJAoboIYO4ObG4Vwla/ekMylE=
github.com/hashicorp/go-azure-helpers v0.66.1 h1:SokAckK9hvQ9PZO2TmZY/CGru8KWJ4A7hcRUggHMEus=
github.com/hashicorp/go-azure-helpers v0.66.1/go.mod h1:kJxXrFtJKJdOEqvad8pllAe7dhP4DbN8J6sqFZe47+4=
github.com/hashicorp/go-azure-sdk v0.20240118.1175416 h1:y3/7PWAxvmSIx5u3Cg1EmR2zyLJAM2rvAFYnW2JIeiQ=
github.com/hashicorp/go-azure-sdk v0.20240118.1175416/go.mod h1:3KI/ojBQAAMjtXPxCP9A5EyNMWlDQarITxGLmGj9tGI=
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
2 changes: 1 addition & 1 deletion internal/services/authorization/parse/role_definition.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type RoleDefinitionID struct {
RoleID string
}

var _ resourceids.ResourceId = RoleDefinitionID{}
var _ resourceids.Id = RoleDefinitionID{}

func (r RoleDefinitionID) ID() string {
return fmt.Sprintf("%s|%s", r.ResourceID, r.Scope)
Expand Down
22 changes: 18 additions & 4 deletions internal/services/compute/parse/community_gallery_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids"
)

var _ resourceids.ResourceId = CommunityGalleryImageId{}
var _ resourceids.ResourceId = &CommunityGalleryImageId{}

type CommunityGalleryImageId struct {
GalleryName string
Expand Down Expand Up @@ -50,18 +50,32 @@ func (id CommunityGalleryImageId) Segments() []resourceids.Segment {
// CommunityGalleryImageID parses a CommunityGalleryImage Unique ID into an CommunityGalleryImageId struct
func CommunityGalleryImageID(input string) (*CommunityGalleryImageId, error) {
id := CommunityGalleryImageId{}
parsed, err := resourceids.NewParserFromResourceIdType(id).Parse(input, false)
parsed, err := resourceids.NewParserFromResourceIdType(&id).Parse(input, false)
if err != nil {
return nil, err
}

var ok bool
if id.GalleryName, ok = parsed.Parsed["galleryName"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "galleryName", *parsed)
return nil, resourceids.NewSegmentNotSpecifiedError(&id, "galleryName", *parsed)
}
if id.ImageName, ok = parsed.Parsed["imageName"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "imageName", *parsed)
return nil, resourceids.NewSegmentNotSpecifiedError(&id, "imageName", *parsed)
}

return &id, nil
}

func (id *CommunityGalleryImageId) FromParseResult(input resourceids.ParseResult) error {
var ok bool

if id.GalleryName, ok = input.Parsed["galleryName"]; !ok {
return resourceids.NewSegmentNotSpecifiedError(id, "galleryName", input)
}

if id.ImageName, ok = input.Parsed["imageName"]; !ok {
return resourceids.NewSegmentNotSpecifiedError(id, "imageName", input)
}

return nil
}
28 changes: 23 additions & 5 deletions internal/services/compute/parse/community_gallery_image_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids"
)

var _ resourceids.ResourceId = CommunityGalleryImageVersionId{}
var _ resourceids.ResourceId = &CommunityGalleryImageVersionId{}

type CommunityGalleryImageVersionId struct {
GalleryName string
Expand Down Expand Up @@ -56,20 +56,20 @@ func (id CommunityGalleryImageVersionId) Segments() []resourceids.Segment {
// CommunityGalleryImageVersionID parses a CommunityGalleryImageVersion Unique ID into an CommunityGalleryImageVersionId struct
func CommunityGalleryImageVersionID(input string) (*CommunityGalleryImageVersionId, error) {
id := CommunityGalleryImageVersionId{}
parsed, err := resourceids.NewParserFromResourceIdType(id).Parse(input, false)
parsed, err := resourceids.NewParserFromResourceIdType(&id).Parse(input, false)
if err != nil {
return nil, err
}

var ok bool
if id.GalleryName, ok = parsed.Parsed["galleryName"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "galleryName", *parsed)
return nil, resourceids.NewSegmentNotSpecifiedError(&id, "galleryName", *parsed)
}
if id.ImageName, ok = parsed.Parsed["imageName"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "imageName", *parsed)
return nil, resourceids.NewSegmentNotSpecifiedError(&id, "imageName", *parsed)
}
if id.Version, ok = parsed.Parsed["version"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "version", *parsed)
return nil, resourceids.NewSegmentNotSpecifiedError(&id, "version", *parsed)
}

// Additional validation for version, it can be the word "latest" or
Expand All @@ -91,3 +91,21 @@ func CommunityGalleryImageVersionID(input string) (*CommunityGalleryImageVersion

return &id, nil
}

func (id *CommunityGalleryImageVersionId) FromParseResult(input resourceids.ParseResult) error {
var ok bool

if id.GalleryName, ok = input.Parsed["galleryName"]; !ok {
return resourceids.NewSegmentNotSpecifiedError(id, "galleryName", input)
}

if id.ImageName, ok = input.Parsed["imageName"]; !ok {
return resourceids.NewSegmentNotSpecifiedError(id, "imageName", input)
}

if id.Version, ok = input.Parsed["version"]; !ok {
return resourceids.NewSegmentNotSpecifiedError(id, "imageName", input)
}

return nil
}
22 changes: 18 additions & 4 deletions internal/services/compute/parse/shared_gallery_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids"
)

var _ resourceids.ResourceId = SharedGalleryImageId{}
var _ resourceids.ResourceId = &SharedGalleryImageId{}

type SharedGalleryImageId struct {
GalleryName string
Expand Down Expand Up @@ -50,18 +50,32 @@ func (id SharedGalleryImageId) Segments() []resourceids.Segment {
// SharedGalleryImageID parses a SharedGalleryImage Unique ID into an SharedGalleryImageId struct
func SharedGalleryImageID(input string) (*SharedGalleryImageId, error) {
id := SharedGalleryImageId{}
parsed, err := resourceids.NewParserFromResourceIdType(id).Parse(input, false)
parsed, err := resourceids.NewParserFromResourceIdType(&id).Parse(input, false)
if err != nil {
return nil, err
}

var ok bool
if id.GalleryName, ok = parsed.Parsed["galleryName"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "galleryName", *parsed)
return nil, resourceids.NewSegmentNotSpecifiedError(&id, "galleryName", *parsed)
}
if id.ImageName, ok = parsed.Parsed["imageName"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "imageName", *parsed)
return nil, resourceids.NewSegmentNotSpecifiedError(&id, "imageName", *parsed)
}

return &id, nil
}

func (id *SharedGalleryImageId) FromParseResult(input resourceids.ParseResult) error {
var ok bool

if id.GalleryName, ok = input.Parsed["galleryName"]; !ok {
return resourceids.NewSegmentNotSpecifiedError(id, "galleryName", input)
}

if id.ImageName, ok = input.Parsed["imageName"]; !ok {
return resourceids.NewSegmentNotSpecifiedError(id, "imageName", input)
}

return nil
}
28 changes: 23 additions & 5 deletions internal/services/compute/parse/shared_gallery_image_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids"
)

var _ resourceids.ResourceId = SharedGalleryImageVersionId{}
var _ resourceids.ResourceId = &SharedGalleryImageVersionId{}

type SharedGalleryImageVersionId struct {
GalleryName string
Expand Down Expand Up @@ -56,20 +56,20 @@ func (id SharedGalleryImageVersionId) Segments() []resourceids.Segment {
// SharedGalleryImageVersionID parses a SharedGalleryImageVersion Unique ID into an SharedGalleryImageVersionId struct
func SharedGalleryImageVersionID(input string) (*SharedGalleryImageVersionId, error) {
id := SharedGalleryImageVersionId{}
parsed, err := resourceids.NewParserFromResourceIdType(id).Parse(input, false)
parsed, err := resourceids.NewParserFromResourceIdType(&id).Parse(input, false)
if err != nil {
return nil, err
}

var ok bool
if id.GalleryName, ok = parsed.Parsed["galleryName"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "galleryName", *parsed)
return nil, resourceids.NewSegmentNotSpecifiedError(&id, "galleryName", *parsed)
}
if id.ImageName, ok = parsed.Parsed["imageName"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "imageName", *parsed)
return nil, resourceids.NewSegmentNotSpecifiedError(&id, "imageName", *parsed)
}
if id.Version, ok = parsed.Parsed["version"]; !ok {
return nil, resourceids.NewSegmentNotSpecifiedError(id, "version", *parsed)
return nil, resourceids.NewSegmentNotSpecifiedError(&id, "version", *parsed)
}

// Additional validation for version, it can be the word "latest" or
Expand All @@ -92,3 +92,21 @@ func SharedGalleryImageVersionID(input string) (*SharedGalleryImageVersionId, er

return &id, nil
}

func (id *SharedGalleryImageVersionId) FromParseResult(input resourceids.ParseResult) error {
var ok bool

if id.GalleryName, ok = input.Parsed["galleryName"]; !ok {
return resourceids.NewSegmentNotSpecifiedError(id, "galleryName", input)
}

if id.ImageName, ok = input.Parsed["imageName"]; !ok {
return resourceids.NewSegmentNotSpecifiedError(id, "imageName", input)
}

if id.Version, ok = input.Parsed["version"]; !ok {
return resourceids.NewSegmentNotSpecifiedError(id, "version", input)
}

return nil
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func protectedSettingsFromKeyVaultSchema(conflictsWithProtectedSettings bool) *p
ValidateFunc: keyVaultValidate.NestedItemId,
},

"source_vault_id": commonschema.ResourceIDReferenceRequired(commonids.KeyVaultId{}),
"source_vault_id": commonschema.ResourceIDReferenceRequired(&commonids.KeyVaultId{}),
},
},
}
Expand Down
4 changes: 2 additions & 2 deletions internal/services/compute/shared_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ func linuxSecretSchema() *pluginsdk.Schema {
Elem: &pluginsdk.Resource{
Schema: map[string]*pluginsdk.Schema{
// whilst this isn't present in the nested object it's required when this is specified
"key_vault_id": commonschema.ResourceIDReferenceRequired(commonids.KeyVaultId{}),
"key_vault_id": commonschema.ResourceIDReferenceRequired(&commonids.KeyVaultId{}),

// whilst we /could/ flatten this to `certificate_urls` we're intentionally not to keep this
// closer to the Windows VMSS resource, which will also take a `store` param
Expand Down Expand Up @@ -584,7 +584,7 @@ func windowsSecretSchema() *pluginsdk.Schema {
Elem: &pluginsdk.Resource{
Schema: map[string]*pluginsdk.Schema{
// whilst this isn't present in the nested object it's required when this is specified
"key_vault_id": commonschema.ResourceIDReferenceRequired(commonids.KeyVaultId{}),
"key_vault_id": commonschema.ResourceIDReferenceRequired(&commonids.KeyVaultId{}),

"certificate": {
Type: pluginsdk.TypeSet,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func resourceDataFactoryLinkedServiceKeyVault() *pluginsdk.Resource {
ValidateFunc: factories.ValidateFactoryID,
},

"key_vault_id": commonschema.ResourceIDReferenceRequired(commonids.KeyVaultId{}),
"key_vault_id": commonschema.ResourceIDReferenceRequired(&commonids.KeyVaultId{}),

"description": {
Type: pluginsdk.TypeString,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func resourceKeyVaultAccessPolicy() *pluginsdk.Resource {
},

Schema: map[string]*pluginsdk.Schema{
"key_vault_id": commonschema.ResourceIDReferenceRequiredForceNew(commonids.KeyVaultId{}),
"key_vault_id": commonschema.ResourceIDReferenceRequiredForceNew(&commonids.KeyVaultId{}),

"tenant_id": {
Type: pluginsdk.TypeString,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type Contact struct {

func (r KeyVaultCertificateContactsResource) Arguments() map[string]*pluginsdk.Schema {
return map[string]*pluginsdk.Schema{
"key_vault_id": commonschema.ResourceIDReferenceRequiredForceNew(commonids.KeyVaultId{}),
"key_vault_id": commonschema.ResourceIDReferenceRequiredForceNew(&commonids.KeyVaultId{}),

"contact": {
Type: pluginsdk.TypeSet,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func dataSourceKeyVaultCertificateData() *pluginsdk.Resource {
ValidateFunc: validate.NestedItemName,
},

"key_vault_id": commonschema.ResourceIDReferenceRequired(commonids.KeyVaultId{}),
"key_vault_id": commonschema.ResourceIDReferenceRequired(&commonids.KeyVaultId{}),

"version": {
Type: pluginsdk.TypeString,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func dataSourceKeyVaultCertificate() *pluginsdk.Resource {
ValidateFunc: keyVaultValidate.NestedItemName,
},

"key_vault_id": commonschema.ResourceIDReferenceRequired(commonids.KeyVaultId{}),
"key_vault_id": commonschema.ResourceIDReferenceRequired(&commonids.KeyVaultId{}),

"resource_manager_id": {
Computed: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func dataSourceKeyVaultCertificateIssuer() *pluginsdk.Resource {
},

Schema: map[string]*pluginsdk.Schema{
"key_vault_id": commonschema.ResourceIDReferenceRequired(commonids.KeyVaultId{}),
"key_vault_id": commonschema.ResourceIDReferenceRequired(&commonids.KeyVaultId{}),

"name": {
Type: pluginsdk.TypeString,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func resourceKeyVaultCertificateIssuer() *pluginsdk.Resource {
},

Schema: map[string]*pluginsdk.Schema{
"key_vault_id": commonschema.ResourceIDReferenceRequiredForceNew(commonids.KeyVaultId{}),
"key_vault_id": commonschema.ResourceIDReferenceRequiredForceNew(&commonids.KeyVaultId{}),

"name": {
Type: pluginsdk.TypeString,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func resourceKeyVaultCertificate() *pluginsdk.Resource {
ValidateFunc: keyVaultValidate.NestedItemName,
},

"key_vault_id": commonschema.ResourceIDReferenceRequiredForceNew(commonids.KeyVaultId{}),
"key_vault_id": commonschema.ResourceIDReferenceRequiredForceNew(&commonids.KeyVaultId{}),

"certificate": {
Type: pluginsdk.TypeList,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func dataSourceKeyVaultCertificates() *pluginsdk.Resource {
},

Schema: map[string]*pluginsdk.Schema{
"key_vault_id": commonschema.ResourceIDReferenceRequired(commonids.KeyVaultId{}),
"key_vault_id": commonschema.ResourceIDReferenceRequired(&commonids.KeyVaultId{}),

"names": {
Type: pluginsdk.TypeList,
Expand Down
2 changes: 1 addition & 1 deletion internal/services/keyvault/key_vault_key_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func dataSourceKeyVaultKey() *pluginsdk.Resource {
ValidateFunc: keyVaultValidate.NestedItemName,
},

"key_vault_id": commonschema.ResourceIDReferenceRequired(commonids.KeyVaultId{}),
"key_vault_id": commonschema.ResourceIDReferenceRequired(&commonids.KeyVaultId{}),

"key_type": {
Type: pluginsdk.TypeString,
Expand Down
2 changes: 1 addition & 1 deletion internal/services/keyvault/key_vault_key_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func resourceKeyVaultKey() *pluginsdk.Resource {
ValidateFunc: keyVaultValidate.NestedItemName,
},

"key_vault_id": commonschema.ResourceIDReferenceRequiredForceNew(commonids.KeyVaultId{}),
"key_vault_id": commonschema.ResourceIDReferenceRequiredForceNew(&commonids.KeyVaultId{}),

"key_type": {
Type: pluginsdk.TypeString,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func resourceKeyVaultManagedStorageAccount() *pluginsdk.Resource {
ValidateFunc: keyVaultValidate.NestedItemName,
},

"key_vault_id": commonschema.ResourceIDReferenceRequiredForceNew(commonids.KeyVaultId{}),
"key_vault_id": commonschema.ResourceIDReferenceRequiredForceNew(&commonids.KeyVaultId{}),

"storage_account_key": {
Type: pluginsdk.TypeString,
Expand Down
2 changes: 1 addition & 1 deletion internal/services/keyvault/key_vault_secret_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func dataSourceKeyVaultSecret() *pluginsdk.Resource {
ValidateFunc: keyVaultValidate.NestedItemName,
},

"key_vault_id": commonschema.ResourceIDReferenceRequired(commonids.KeyVaultId{}),
"key_vault_id": commonschema.ResourceIDReferenceRequired(&commonids.KeyVaultId{}),

"value": {
Type: pluginsdk.TypeString,
Expand Down
2 changes: 1 addition & 1 deletion internal/services/keyvault/key_vault_secret_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func resourceKeyVaultSecret() *pluginsdk.Resource {
ValidateFunc: keyVaultValidate.NestedItemName,
},

"key_vault_id": commonschema.ResourceIDReferenceRequiredForceNew(commonids.KeyVaultId{}),
"key_vault_id": commonschema.ResourceIDReferenceRequiredForceNew(&commonids.KeyVaultId{}),

"value": {
Type: pluginsdk.TypeString,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func dataSourceKeyVaultSecrets() *pluginsdk.Resource {
},

Schema: map[string]*pluginsdk.Schema{
"key_vault_id": commonschema.ResourceIDReferenceRequired(commonids.KeyVaultId{}),
"key_vault_id": commonschema.ResourceIDReferenceRequired(&commonids.KeyVaultId{}),

"names": {
Type: pluginsdk.TypeList,
Expand Down
Loading

0 comments on commit fef23e4

Please sign in to comment.