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

fix: align setup of resource and data source id for testing framework #303

Merged
merged 12 commits into from
Jul 20, 2023
Merged
2 changes: 1 addition & 1 deletion docs/resources/directory_role_collection.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ resource "btp_directory_role_collection" "my_collection" {

### Read-Only

- `id` (String, Deprecated) The ID of the directory.
- `id` (String, Deprecated) The combined unique ID of the role collection as used for import operations.

<a id="nestedatt--roles"></a>
### Nested Schema for `roles`
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/directory_role_collection_assignment.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ resource "btp_directory_role_collection_assignment" "directory_viewer_group" {

### Read-Only

- `id` (String, Deprecated) The ID of the role collection
- `id` (String, Deprecated) The combined unique ID of the role collection.


2 changes: 1 addition & 1 deletion docs/resources/globalaccount_role_collection_assignment.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ resource "btp_globalaccount_role_collection_assignment" "globalaccount_viewer_gr

### Read-Only

- `id` (String, Deprecated) The ID of the role collection
- `id` (String, Deprecated) The combined unique ID of the role collection.


2 changes: 1 addition & 1 deletion docs/resources/subaccount_role_collection.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ resource "btp_subaccount_role_collection" "my_collection" {

### Read-Only

- `id` (String, Deprecated) The ID of the role collection.
- `id` (String, Deprecated) The combined unique ID of the role collection as used for import operations.

<a id="nestedatt--roles"></a>
### Nested Schema for `roles`
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/subaccount_role_collection_assignment.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ resource "btp_subaccount_role_collection_assignment" "subaccount_viewer_group" {

### Read-Only

- `id` (String, Deprecated) The ID of the role collection
- `id` (String, Deprecated) The combined unique ID of the role collection.


2 changes: 1 addition & 1 deletion internal/provider/datasource_directory_entitlements.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ To view all the resources that a directory and its subdirectories and subaccount
uuidvalidator.ValidUUID(),
},
},
"id": schema.StringAttribute{
"id": schema.StringAttribute{ // required by hashicorps terraform plugin testing framework
DeprecationMessage: "Use the `directory_id` attribute instead",
MarkdownDescription: "The ID of the directory.",
Computed: true,
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/datasource_directory_labels.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ __Further documentation:__
uuidvalidator.ValidUUID(),
},
},
"id": schema.StringAttribute{
"id": schema.StringAttribute{ // required by hashicorps terraform plugin testing framework
DeprecationMessage: "Use the `directory_id` attribute instead",
MarkdownDescription: "The ID of the directory.",
Computed: true,
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/datasource_directory_role.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (ds *directoryRoleDataSource) Schema(_ context.Context, _ datasource.Schema
uuidvalidator.ValidUUID(),
},
},
"id": schema.StringAttribute{ // required hashicorps terraform plugin testing framework
"id": schema.StringAttribute{ // required by hashicorps terraform plugin testing framework
DeprecationMessage: "Use the `directory_id` attribute instead",
MarkdownDescription: "The ID of the directory.",
Computed: true,
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/datasource_directory_role_collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (ds *directoryRoleCollectionDataSource) Schema(_ context.Context, _ datasou
uuidvalidator.ValidUUID(),
},
},
"id": schema.StringAttribute{ // required hashicorps terraform plugin testing framework
"id": schema.StringAttribute{ // required by hashicorps terraform plugin testing framework
DeprecationMessage: "Use the `directory_id` attribute instead",
MarkdownDescription: "The ID of the directory.",
Computed: true,
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/datasource_directory_role_collections.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (ds *directoryRoleCollectionsDataSource) Schema(_ context.Context, _ dataso
uuidvalidator.ValidUUID(),
},
},
"id": schema.StringAttribute{ // required hashicorps terraform plugin testing framework
"id": schema.StringAttribute{ // required by hashicorps terraform plugin testing framework
DeprecationMessage: "Use the `directory_id` attribute instead",
MarkdownDescription: "The ID of the directory.",
Computed: true,
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/datasource_directory_roles.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ __Further documentation:__
uuidvalidator.ValidUUID(),
},
},
"id": schema.StringAttribute{ // required hashicorps terraform plugin testing framework
"id": schema.StringAttribute{ // required by hashicorps terraform plugin testing framework
DeprecationMessage: "Use the `directory_id` attribute instead",
MarkdownDescription: "The ID of the directory.",
Computed: true,
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/datasource_directory_users.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ __Further documentation:__
uuidvalidator.ValidUUID(),
},
},
"id": schema.StringAttribute{ // required hashicorps terraform plugin testing framework
"id": schema.StringAttribute{ // required by hashicorps terraform plugin testing framework
DeprecationMessage: "Use the `directory_id` attribute instead",
MarkdownDescription: "The ID of the directory.",
Computed: true,
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/datasource_globalaccount_entitlements.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ To view all the resources a global account:
* Target only the global account in the command line.
* You must be assigned to either the global account admin or global account viewers role.`,
Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{
"id": schema.StringAttribute{ // required by hashicorps terraform plugin testing framework
DeprecationMessage: "Use the `btp_globalaccount` datasource instead",
MarkdownDescription: "The ID of the global account.",
Computed: true,
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/datasource_globalaccount_role.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (ds *globalaccountRoleDataSource) Schema(_ context.Context, _ datasource.Sc
resp.Schema = schema.Schema{
MarkdownDescription: `Gets details about a specific global account role.`,
Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{ // required hashicorps terraform plugin testing framework
"id": schema.StringAttribute{ // required by hashicorps terraform plugin testing framework
DeprecationMessage: "Use the `btp_globalaccount` datasource instead",
MarkdownDescription: "The ID of the global account",
Computed: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (ds *globalaccountRoleCollectionDataSource) Schema(_ context.Context, _ dat
stringvalidator.LengthAtLeast(1),
},
},
"id": schema.StringAttribute{
"id": schema.StringAttribute{ // required by hashicorps terraform plugin testing framework
DeprecationMessage: "Use the `btp_globalaccount` datasource instead",
MarkdownDescription: "The ID of the global account.",
Computed: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (ds *globalaccountRoleCollectionsDataSource) Schema(_ context.Context, _ da
resp.Schema = schema.Schema{
MarkdownDescription: `Gets all role collections.`,
Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{ // required hashicorps terraform plugin testing framework
"id": schema.StringAttribute{ // required by hashicorps terraform plugin testing framework
DeprecationMessage: "Use the `btp_globalaccount` datasource instead",
MarkdownDescription: "The ID of the global account",
Computed: true,
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/datasource_globalaccount_roles.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (ds *globalaccountRolesDataSource) Schema(_ context.Context, _ datasource.S
__Further documentation:__
<https://help.sap.com/docs/btp/sap-business-technology-platform/role-collections-and-roles-in-global-accounts-directories-and-subaccounts>`,
Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{ // required hashicorps terraform plugin testing framework
"id": schema.StringAttribute{ // required by hashicorps terraform plugin testing framework
DeprecationMessage: "Use the `btp_globalaccount` datasource instead",
MarkdownDescription: "The ID of the global account.",
Computed: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ You must be viewer or administrator of the global account.
__Further documentation:__
<https://help.sap.com/docs/btp/sap-business-technology-platform/trust-and-federation-with-identity-providers>`,
Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{
"id": schema.StringAttribute{ // required by hashicorps terraform plugin testing framework
DeprecationMessage: "Use the `btp_globalaccount` datasource instead",
MarkdownDescription: "The ID of the global account.",
Computed: true,
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/datasource_globalaccount_users.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (ds *globalaccountUsersDataSource) Schema(_ context.Context, _ datasource.S
__Further documentation:__
<https://help.sap.com/docs/btp/sap-business-technology-platform/user-and-member-management>`,
Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{
"id": schema.StringAttribute{ // required by hashicorps terraform plugin testing framework
DeprecationMessage: "Use the `btp_globalaccount` datasource instead",
MarkdownDescription: "The ID of the global account.",
Computed: true,
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/datasource_regions.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (ds *regionsDataSource) Schema(_ context.Context, _ datasource.SchemaReques
__Tip:__
You must be assigned to the global account admin or viewer role.`,
Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{
"id": schema.StringAttribute{ // required by hashicorps terraform plugin testing framework
DeprecationMessage: "Use the `btp_globalaccount` datasource instead",
MarkdownDescription: "The ID of the global account.",
Computed: true,
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/datasource_subaccount_apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func (ds *subaccountAppsDataSource) Schema(_ context.Context, _ datasource.Schem
uuidvalidator.ValidUUID(),
},
},
"id": schema.StringAttribute{ // required hashicorps terraform plugin testing framework
"id": schema.StringAttribute{ // required by hashicorps terraform plugin testing framework
DeprecationMessage: "Use the `subaccount_id` attribute instead",
MarkdownDescription: "The ID of the subaccount.",
Computed: true,
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/datasource_subaccount_entitlements.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (ds *subaccountEntitlementsDataSource) Schema(_ context.Context, _ datasour
To get all entitlements and quota assigned to a specific subaccount:
* You must be assigned to either the subaccount admin or subaccount viewer role.`,
Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{
"id": schema.StringAttribute{ // required by hashicorps terraform plugin testing framework
DeprecationMessage: "Use the `subaccount_id` attribute instead",
MarkdownDescription: "The ID of the subaccount.",
Computed: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ You must be assigned to the subaccount admin or viewer role.`,
uuidvalidator.ValidUUID(),
},
},
"id": schema.StringAttribute{
"id": schema.StringAttribute{ // required by hashicorps terraform plugin testing framework
DeprecationMessage: "Use the `subaccount_id` attribute instead",
MarkdownDescription: "The ID of the subaccount.",
Computed: true,
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/datasource_subaccount_environments.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ You must be assigned to the subaccount admin or viewer role.`,
uuidvalidator.ValidUUID(),
},
},
"id": schema.StringAttribute{
"id": schema.StringAttribute{ // required by hashicorps terraform plugin testing framework
DeprecationMessage: "Use the `subaccount_id` attribute instead",
MarkdownDescription: "The ID of the subaccount.",
Computed: true,
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/datasource_subaccount_labels.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ __Further documentation:__
uuidvalidator.ValidUUID(),
},
},
"id": schema.StringAttribute{
"id": schema.StringAttribute{ // required by hashicorps terraform plugin testing framework
DeprecationMessage: "Use the `subaccount_id` attribute instead",
MarkdownDescription: "The ID of the subaccount.",
Computed: true,
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/datasource_subaccount_role.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (ds *subaccountRoleDataSource) Schema(_ context.Context, _ datasource.Schem
uuidvalidator.ValidUUID(),
},
},
"id": schema.StringAttribute{ // required hashicorps terraform plugin testing framework
"id": schema.StringAttribute{ // required by hashicorps terraform plugin testing framework
DeprecationMessage: "Use the `subaccount_id` attribute instead",
MarkdownDescription: "The ID of the subaccount.",
Computed: true,
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/datasource_subaccount_role_collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (ds *subaccountRoleCollectionDataSource) Schema(_ context.Context, _ dataso
uuidvalidator.ValidUUID(),
},
},
"id": schema.StringAttribute{ // required hashicorps terraform plugin testing framework
"id": schema.StringAttribute{ // required by hashicorps terraform plugin testing framework
DeprecationMessage: "Use the `subaccount_id` attribute instead",
MarkdownDescription: "The ID of the subaccount.",
Computed: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (ds *subaccountRoleCollectionsDataSource) Schema(_ context.Context, _ datas
uuidvalidator.ValidUUID(),
},
},
"id": schema.StringAttribute{ // required hashicorps terraform plugin testing framework
"id": schema.StringAttribute{ // required by hashicorps terraform plugin testing framework
DeprecationMessage: "Use the `subaccount_id` attribute instead",
MarkdownDescription: "The ID of the subaccount.",
Computed: true,
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/datasource_subaccount_roles.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ __Further documentation:__
uuidvalidator.ValidUUID(),
},
},
"id": schema.StringAttribute{ // required hashicorps terraform plugin testing framework
"id": schema.StringAttribute{ // required by hashicorps terraform plugin testing framework
DeprecationMessage: "Use the `subaccount_id` attribute instead",
MarkdownDescription: "The ID of the subaccount.",
Computed: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (ds *subaccountServiceBindingsDataSource) Schema(_ context.Context, _ datas
uuidvalidator.ValidUUID(),
},
},
"id": schema.StringAttribute{ // required hashicorps terraform plugin testing framework
"id": schema.StringAttribute{ // required by hashicorps terraform plugin testing framework
DeprecationMessage: "Use the `subaccount_id` attribute instead",
MarkdownDescription: "The ID of the subaccount.",
Computed: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (ds *subaccountServiceInstancesDataSource) Schema(_ context.Context, _ data
uuidvalidator.ValidUUID(),
},
},
"id": schema.StringAttribute{ // required hashicorps terraform plugin testing framework
"id": schema.StringAttribute{ // required by hashicorps terraform plugin testing framework
DeprecationMessage: "Use the `subaccount_id` attribute instead",
MarkdownDescription: "The ID of the subaccount.",
Computed: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (ds *subaccountServiceOfferingsDataSource) Schema(_ context.Context, _ data
uuidvalidator.ValidUUID(),
},
},
"id": schema.StringAttribute{ // required hashicorps terraform plugin testing framework
"id": schema.StringAttribute{ // required by hashicorps terraform plugin testing framework
DeprecationMessage: "Use the `subaccount_id` attribute instead",
MarkdownDescription: "The ID of the subaccount.",
Computed: true,
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/datasource_subaccount_service_plans.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (ds *subaccountServicePlansDataSource) Schema(_ context.Context, _ datasour
uuidvalidator.ValidUUID(),
},
},
"id": schema.StringAttribute{ // required hashicorps terraform plugin testing framework
"id": schema.StringAttribute{ // required by hashicorps terraform plugin testing framework
DeprecationMessage: "Use the `subaccount_id` attribute instead",
MarkdownDescription: "The ID of the subaccount.",
Computed: true,
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/datasource_subaccount_subscriptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ You must be assigned to the subaccount admin or viewer role.`,
uuidvalidator.ValidUUID(),
},
},
"id": schema.StringAttribute{ // required hashicorps terraform plugin testing framework
"id": schema.StringAttribute{ // required by hashicorps terraform plugin testing framework
DeprecationMessage: "Use the `subaccount_id` attribute instead",
MarkdownDescription: "The ID of the subaccount.",
Computed: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ __Further documentation:__
uuidvalidator.ValidUUID(),
},
},
"id": schema.StringAttribute{ // required hashicorps terraform plugin testing framework
"id": schema.StringAttribute{ // required by hashicorps terraform plugin testing framework
DeprecationMessage: "Use the `subaccount_id` attribute instead",
MarkdownDescription: "The ID of the subaccount.",
Computed: true,
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/datasource_subaccount_users.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ __Further documentation:__
uuidvalidator.ValidUUID(),
},
},
"id": schema.StringAttribute{
"id": schema.StringAttribute{ // required by hashicorps terraform plugin testing framework
DeprecationMessage: "Use the `subaccount_id` attribute instead",
MarkdownDescription: "The ID of the subaccount.",
Computed: true,
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/datasource_subaccounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ You must be assigned to the admin or viewer role of the global account, director
stringvalidator.LengthAtLeast(1),
},
},
"id": schema.StringAttribute{
"id": schema.StringAttribute{ // required by hashicorps terraform plugin testing framework
DeprecationMessage: "Use the `btp_globalaccount` datasource instead",
MarkdownDescription: "The ID of the global account.",
Computed: true,
Expand Down
Loading
Loading