Skip to content

Commit

Permalink
update web app config datasource to plugin-framework (GoogleCloudPlat…
Browse files Browse the repository at this point in the history
…form#7501)

* Revert "revert plugin framework code (GoogleCloudPlatform#7287)"

This reverts commit 06f9b2e.

* changes to plugin-framework work for parity

* add some provider tests fix other inconsistent errors with the sdk provider

* update provider alias name

* other changes

* fix up base path test

* update tests to use muxer

* use beta provider when we need to for some of the provider tests

* remove all the specific providers from the config

* attempt to fix vcr tests

* refactor the vcr configuration

* capitalize provider factories

* some test failure fixes

* remove skip step if vcr

* review comments

* fixed pointer errors

* move providerversion450 to be dependent on resource, revers diag pointers

* reverse another pointer

* update firebase apple app config datasource to plugin-framework

* update with latest plugin-framework changes

* Revert "revert plugin framework code (GoogleCloudPlatform#7287)"

This reverts commit 06f9b2e.

* changes to plugin-framework work for parity

* add some provider tests fix other inconsistent errors with the sdk provider

* update tests to use muxer

* use beta provider when we need to for some of the provider tests

* remove all the specific providers from the config

* changes after merge

* attempt to fix vcr tests

* refactor the vcr configuration

* capitalize provider factories

* some test failure fixes

* remove skip step if vcr

* review comments

* fixed pointer errors

* move providerversion450 to be dependent on resource, revers diag pointers

* update firebase apple app config datasource to plugin-framework

* update web app config

* update external provider version tests

* rm non erb, bad merge maybe

* update after a bad merge

* add comments

* review comments, applied them to dns data sources as well
  • Loading branch information
megan07 authored and diogo esteves committed Mar 31, 2023
1 parent 6eb5f17 commit 2fb1689
Show file tree
Hide file tree
Showing 9 changed files with 236 additions and 128 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ import (
)

// Ensure the implementation satisfies the expected interfaces
var _ datasource.DataSource = &GoogleDnsKeysDataSource{}
var (
_ datasource.DataSource = &GoogleDnsKeysDataSource{}
_ datasource.DataSourceWithConfigure = &GoogleDnsKeysDataSource{}
)

func NewGoogleDnsKeysDataSource() datasource.DataSource {
return &GoogleDnsKeysDataSource{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ import (
)

// Ensure the implementation satisfies the expected interfaces
var _ datasource.DataSource = &GoogleDnsManagedZoneDataSource{}
var (
_ datasource.DataSource = &GoogleDnsManagedZoneDataSource{}
_ datasource.DataSourceWithConfigure = &GoogleDnsManagedZoneDataSource{}
)

func NewGoogleDnsManagedZoneDataSource() datasource.DataSource {
return &GoogleDnsManagedZoneDataSource{}
Expand Down Expand Up @@ -47,18 +50,25 @@ func (d *GoogleDnsManagedZoneDataSource) Schema(ctx context.Context, req datasou
MarkdownDescription: "Provides access to a zone's attributes within Google Cloud DNS",

Attributes: map[string]schema.Attribute{
"dns_name": schema.StringAttribute{
Description: "The fully qualified DNS name of this zone.",
MarkdownDescription: "The fully qualified DNS name of this zone.",
Computed: true,
},

"name": schema.StringAttribute{
Description: "A unique name for the resource.",
MarkdownDescription: "A unique name for the resource.",
Required: true,
},

// Google Cloud DNS ManagedZone resources do not have a SelfLink attribute.
"project": schema.StringAttribute{
Description: "The ID of the project for the Google Cloud.",
MarkdownDescription: "The ID of the project for the Google Cloud.",
Optional: true,
},

"dns_name": schema.StringAttribute{
Description: "The fully qualified DNS name of this zone.",
MarkdownDescription: "The fully qualified DNS name of this zone.",
Computed: true,
},

"description": schema.StringAttribute{
Description: "A textual description field.",
MarkdownDescription: "A textual description field.",
Expand Down Expand Up @@ -90,12 +100,6 @@ func (d *GoogleDnsManagedZoneDataSource) Schema(ctx context.Context, req datasou
Computed: true,
},

// Google Cloud DNS ManagedZone resources do not have a SelfLink attribute.
"project": schema.StringAttribute{
Description: "The ID of the project for the Google Cloud.",
MarkdownDescription: "The ID of the project for the Google Cloud.",
Optional: true,
},
"id": schema.StringAttribute{
Description: "DNS managed zone identifier",
MarkdownDescription: "DNS managed zone identifier",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ import (
)

// Ensure the implementation satisfies the expected interfaces
var _ datasource.DataSource = &GoogleDnsRecordSetDataSource{}
var (
_ datasource.DataSource = &GoogleDnsRecordSetDataSource{}
_ datasource.DataSourceWithConfigure = &GoogleDnsRecordSetDataSource{}
)

func NewGoogleDnsRecordSetDataSource() datasource.DataSource {
return &GoogleDnsRecordSetDataSource{}
Expand Down Expand Up @@ -54,6 +57,14 @@ func (d *GoogleDnsRecordSetDataSource) Schema(ctx context.Context, req datasourc
MarkdownDescription: "The DNS name for the resource.",
Required: true,
},
"type": schema.StringAttribute{
MarkdownDescription: "The identifier of a supported record type. See the list of Supported DNS record types.",
Required: true,
},
"project": schema.StringAttribute{
MarkdownDescription: "The ID of the project for the Google Cloud.",
Optional: true,
},
"rrdatas": schema.ListAttribute{
MarkdownDescription: "The string data for the records in this record set.",
Computed: true,
Expand All @@ -63,14 +74,6 @@ func (d *GoogleDnsRecordSetDataSource) Schema(ctx context.Context, req datasourc
MarkdownDescription: "The time-to-live of this record set (seconds).",
Computed: true,
},
"type": schema.StringAttribute{
MarkdownDescription: "The identifier of a supported record type. See the list of Supported DNS record types.",
Required: true,
},
"project": schema.StringAttribute{
MarkdownDescription: "The ID of the project for the Google Cloud.",
Optional: true,
},
"id": schema.StringAttribute{
MarkdownDescription: "DNS record set identifier",
Computed: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<% autogen_exception -%>
package google
<% unless version == 'ga' -%>

import (
"context"
"fmt"
Expand All @@ -13,6 +14,12 @@ import (
"github.com/hashicorp/terraform-plugin-log/tflog"
)

// Ensure the implementation satisfies the expected interfaces
var (
_ datasource.DataSource = &GoogleFirebaseAppleAppConfigDataSource{}
_ datasource.DataSourceWithConfigure = &GoogleFirebaseAppleAppConfigDataSource{}
)

func NewGoogleFirebaseAppleAppConfigDataSource() datasource.DataSource {
return &GoogleFirebaseAppleAppConfigDataSource{}
}
Expand Down Expand Up @@ -47,6 +54,12 @@ func (d *GoogleFirebaseAppleAppConfigDataSource) Schema(ctx context.Context, req
Required: true,
},

"project": schema.StringAttribute{
Description: "The project id of the Firebase iOS App.",
MarkdownDescription: "The project id of the Firebase iOS App.",
Optional: true,
},

"config_filename": schema.StringAttribute{
Description: "The filename that the configuration artifact for the IosApp is typically saved as.",
MarkdownDescription: "The filename that the configuration artifact for the IosApp is typically saved as.",
Expand All @@ -59,12 +72,6 @@ func (d *GoogleFirebaseAppleAppConfigDataSource) Schema(ctx context.Context, req
Computed: true,
},

"project": schema.StringAttribute{
Description: "The project id of the Firebase iOS App.",
MarkdownDescription: "The project id of the Firebase iOS App.",
Optional: true,
},

"id": schema.StringAttribute{
Description: "Firebase Apple App Config identifier",
MarkdownDescription: "Firebase Apple App Config identifier",
Expand Down
Loading

0 comments on commit 2fb1689

Please sign in to comment.