From c9669f3643844435e0ea582f709d83fb09b56d52 Mon Sep 17 00:00:00 2001 From: Daniel Kuntze <137066232+kuntzed@users.noreply.github.com> Date: Thu, 27 Jul 2023 13:29:05 +0200 Subject: [PATCH] fix(resource): fix schema and add tests for resource provider (#339) The schema for the resource provider resource and datasources is fixed and corresponding tests are added. Furthermore, some attribute names were improved. Resolves #337 --- .../globalaccount_resource_provider.md | 14 +- .../facade_accounts_resource_provider.go | 26 +- .../facade_accounts_resource_provider_test.go | 28 +- .../types/provisioning/resource_provider.go | 4 +- ...asource_globalaccount_resource_provider.go | 20 +- ...ce_globalaccount_resource_provider_test.go | 44 + ...source_globalaccount_resource_providers.go | 58 +- ...e_globalaccount_resource_providers_test.go | 37 + ...ource_globalaccount_resource_provider.yaml | 745 +++++++++ ...urce_globalaccount_resource_providers.yaml | 745 +++++++++ ...lobalaccount_resource_provider.create.yaml | 1389 +++++++++++++++++ ...esource_globalaccount_resource_provider.go | 48 +- ...ce_globalaccount_resource_provider_test.go | 76 + .../type_globalaccount_resource_provider.go | 24 +- 14 files changed, 3161 insertions(+), 97 deletions(-) create mode 100644 internal/provider/datasource_globalaccount_resource_provider_test.go create mode 100644 internal/provider/datasource_globalaccount_resource_providers_test.go create mode 100644 internal/provider/fixtures/datasource_globalaccount_resource_provider.yaml create mode 100644 internal/provider/fixtures/datasource_globalaccount_resource_providers.yaml create mode 100644 internal/provider/fixtures/resource_globalaccount_resource_provider.create.yaml create mode 100644 internal/provider/resource_globalaccount_resource_provider_test.go diff --git a/docs/resources/globalaccount_resource_provider.md b/docs/resources/globalaccount_resource_provider.md index a7ba7666..5e779373 100644 --- a/docs/resources/globalaccount_resource_provider.md +++ b/docs/resources/globalaccount_resource_provider.md @@ -63,19 +63,23 @@ resource "btp_globalaccount_resource_provider" "aws" { ### Required -- `id` (String) The unique technical name of the resource provider. -- `parameters` (String, Sensitive) Any relevant information about the resource provider that is not provided by other parameter values. -- `resource_provider` (String) Provider of the requested resource. Possible values are: +- `configuration` (String, Sensitive) The configuration properties for the resource provider as required by the vendor. +- `display_name` (String) The descriptive name of the resource provider. +- `provider_type` (String) The cloud vendor from which to consume services through your subscribed account. Possible values are: | value | description | | --- | --- | | `AWS` | Amazon Web Services | | `AZURE` | Microsoft Azure | +- `technical_name` (String) The unique technical name of the resource provider. -### Read-Only +### Optional - `description` (String) The description of the resource provider. -- `display_name` (String) The descriptive name of the resource provider. + +### Read-Only + +- `id` (String, Deprecated) The unique technical name of the resource provider. ## Import diff --git a/internal/btpcli/facade_accounts_resource_provider.go b/internal/btpcli/facade_accounts_resource_provider.go index 80607cba..fe0b5127 100644 --- a/internal/btpcli/facade_accounts_resource_provider.go +++ b/internal/btpcli/facade_accounts_resource_provider.go @@ -25,39 +25,39 @@ func (f *accountsResourceProviderFacade) List(ctx context.Context) ([]provisioni })) } -func (f *accountsResourceProviderFacade) Get(ctx context.Context, resourceProvider string, resourceTechnicalName string) (provisioning.ResourceProviderResponseObject, CommandResponse, error) { +func (f *accountsResourceProviderFacade) Get(ctx context.Context, provider string, technicalName string) (provisioning.ResourceProviderResponseObject, CommandResponse, error) { return doExecute[provisioning.ResourceProviderResponseObject](f.cliClient, ctx, NewGetRequest(f.getCommand(), map[string]string{ "globalAccount": f.cliClient.GetGlobalAccountSubdomain(), - "provider": resourceProvider, - "technicalName": resourceTechnicalName, + "provider": provider, + "technicalName": technicalName, })) } type GlobalaccountResourceProviderCreateInput struct { - Provider string `btpcli:"provider"` - TechnicalName string `btpcli:"technicalName"` - DisplayName string `btpcli:"displayName"` - Description string `btpcli:"description"` - ConfigurationInfo string `btpcli:"configurationInfo"` + Provider string `btpcli:"provider"` + TechnicalName string `btpcli:"technicalName"` + DisplayName string `btpcli:"displayName"` + Description string `btpcli:"description"` + Configuration string `btpcli:"configurationInfo"` + Globalaccount string `btpcli:"globalAccount"` } func (f *accountsResourceProviderFacade) Create(ctx context.Context, args GlobalaccountResourceProviderCreateInput) (provisioning.ResourceProviderResponseObject, CommandResponse, error) { + args.Globalaccount = f.cliClient.GetGlobalAccountSubdomain() params, err := tfutils.ToBTPCLIParamsMap(args) if err != nil { return provisioning.ResourceProviderResponseObject{}, CommandResponse{}, err } - params["globalAccount"] = f.cliClient.GetGlobalAccountSubdomain() - return doExecute[provisioning.ResourceProviderResponseObject](f.cliClient, ctx, NewCreateRequest(f.getCommand(), params)) } -func (f *accountsResourceProviderFacade) Delete(ctx context.Context, resourceProvider string, resourceTechnicalName string) (provisioning.ResourceProviderResponseObject, CommandResponse, error) { +func (f *accountsResourceProviderFacade) Delete(ctx context.Context, provider string, technicalName string) (provisioning.ResourceProviderResponseObject, CommandResponse, error) { return doExecute[provisioning.ResourceProviderResponseObject](f.cliClient, ctx, NewDeleteRequest(f.getCommand(), map[string]string{ "globalAccount": f.cliClient.GetGlobalAccountSubdomain(), - "provider": resourceProvider, - "technicalName": resourceTechnicalName, + "provider": provider, + "technicalName": technicalName, "confirm": "true", })) } diff --git a/internal/btpcli/facade_accounts_resource_provider_test.go b/internal/btpcli/facade_accounts_resource_provider_test.go index d575993f..458db7a9 100644 --- a/internal/btpcli/facade_accounts_resource_provider_test.go +++ b/internal/btpcli/facade_accounts_resource_provider_test.go @@ -63,11 +63,11 @@ func TestAccountsResourceProviderFacade_Get(t *testing.T) { func TestAccountsResourceProviderFacade_Create(t *testing.T) { command := "accounts/resource-provider" - resourceProvider := "AWS" - resourceTechnicalName := "my_id" + provider := "AWS" + technicalName := "my_id" description := "my-description" displayName := "My display name" - configurationInfo := "{}" + configuration := "{}" t.Run("constructs the CLI params correctly", func(t *testing.T) { var srvCalled bool @@ -77,21 +77,21 @@ func TestAccountsResourceProviderFacade_Create(t *testing.T) { assertCall(t, r, command, ActionCreate, map[string]string{ "globalAccount": "795b53bb-a3f0-4769-adf0-26173282a975", - "provider": resourceProvider, - "technicalName": resourceTechnicalName, + "provider": provider, + "technicalName": technicalName, "description": description, "displayName": displayName, - "configurationInfo": configurationInfo, + "configurationInfo": configuration, }) })) defer srv.Close() _, res, err := uut.Accounts.ResourceProvider.Create(context.TODO(), GlobalaccountResourceProviderCreateInput{ - Provider: resourceProvider, - TechnicalName: resourceTechnicalName, - Description: description, - DisplayName: displayName, - ConfigurationInfo: configurationInfo, + Provider: provider, + TechnicalName: technicalName, + Description: description, + DisplayName: displayName, + Configuration: configuration, }) if assert.True(t, srvCalled) && assert.NoError(t, err) { @@ -103,8 +103,8 @@ func TestAccountsResourceProviderFacade_Create(t *testing.T) { func TestAccountsResourceProviderFacade_Delete(t *testing.T) { command := "accounts/resource-provider" - resourceProvider := "AWS" - resourceTechnicalName := "my_id" + provider := "AWS" + technicalName := "my_id" t.Run("constructs the CLI params correctly", func(t *testing.T) { var srvCalled bool @@ -122,7 +122,7 @@ func TestAccountsResourceProviderFacade_Delete(t *testing.T) { })) defer srv.Close() - _, res, err := uut.Accounts.ResourceProvider.Delete(context.TODO(), resourceProvider, resourceTechnicalName) + _, res, err := uut.Accounts.ResourceProvider.Delete(context.TODO(), provider, technicalName) if assert.True(t, srvCalled) && assert.NoError(t, err) { assert.Equal(t, 200, res.StatusCode) diff --git a/internal/btpcli/types/provisioning/resource_provider.go b/internal/btpcli/types/provisioning/resource_provider.go index 731f8d50..6d1af043 100644 --- a/internal/btpcli/types/provisioning/resource_provider.go +++ b/internal/btpcli/types/provisioning/resource_provider.go @@ -5,8 +5,8 @@ import ( ) type ResourceProviderResponseObject struct { - // Unique technical name of the resource. - ResourceTechnicalName string `json:"technicalName,omitempty"` + // Unique technical name of the resource provider. + TechnicalName string `json:"technicalName,omitempty"` // Type of the resource. ResourceType string `json:"resourceType,omitempty"` // Provider of the requested resource. For example, IaaS provider: AWS. diff --git a/internal/provider/datasource_globalaccount_resource_provider.go b/internal/provider/datasource_globalaccount_resource_provider.go index 730220a3..3401df9b 100644 --- a/internal/provider/datasource_globalaccount_resource_provider.go +++ b/internal/provider/datasource_globalaccount_resource_provider.go @@ -42,8 +42,8 @@ You must be assigned to the global account admin or viewer role. __Further documentation:__ `, Attributes: map[string]schema.Attribute{ - "resource_provider": schema.StringAttribute{ - MarkdownDescription: "The provider of the requested resource. Possible values are: \n" + + "provider_type": schema.StringAttribute{ + MarkdownDescription: "The cloud vendor from which to consume services through your subscribed account. Possible values are: \n" + getFormattedValueAsTableRow("value", "description") + getFormattedValueAsTableRow("---", "---") + getFormattedValueAsTableRow("`AWS`", "Amazon Web Services") + @@ -53,12 +53,14 @@ __Further documentation:__ stringvalidator.LengthAtLeast(1), }, }, - "id": schema.StringAttribute{ + "technical_name": schema.StringAttribute{ MarkdownDescription: "The unique technical name of the resource provider.", Required: true, - Validators: []validator.String{ - stringvalidator.LengthAtLeast(1), - }, + }, + "id": schema.StringAttribute{ + DeprecationMessage: "Use the `technical_name` attribute instead", + MarkdownDescription: "The unique technical name of the resource provider.", + Computed: true, }, "display_name": schema.StringAttribute{ MarkdownDescription: "The descriptive name of the resource provider.", @@ -68,8 +70,8 @@ __Further documentation:__ MarkdownDescription: "The description of the resource provider.", Computed: true, }, - "parameters": schema.StringAttribute{ - MarkdownDescription: "Shows any relevant information about the resource provider that is not provided by other parameter values.", + "configuration": schema.StringAttribute{ + MarkdownDescription: "The configuration properties for the resource provider as required by the vendor.", Computed: true, Sensitive: true, }, @@ -87,7 +89,7 @@ func (ds *globalaccountResourceProviderDataSource) Read(ctx context.Context, req return } - cliRes, _, err := ds.cli.Accounts.ResourceProvider.Get(ctx, data.ResourceProvider.ValueString(), data.Id.ValueString()) + cliRes, _, err := ds.cli.Accounts.ResourceProvider.Get(ctx, data.Provider.ValueString(), data.TechnicalName.ValueString()) if err != nil { resp.Diagnostics.AddError("API Error Reading Resource Resource Provider (Global Account)", fmt.Sprintf("%s", err)) return diff --git a/internal/provider/datasource_globalaccount_resource_provider_test.go b/internal/provider/datasource_globalaccount_resource_provider_test.go new file mode 100644 index 00000000..29c83214 --- /dev/null +++ b/internal/provider/datasource_globalaccount_resource_provider_test.go @@ -0,0 +1,44 @@ +package provider + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" +) + +func TestDataSourceGlobalaccountResourceProvider(t *testing.T) { + t.Parallel() + t.Run("happy path", func(t *testing.T) { + rec := setupVCR(t, "fixtures/datasource_globalaccount_resource_provider") + defer stopQuietly(rec) + + resource.Test(t, resource.TestCase{ + IsUnitTest: true, + ProtoV6ProviderFactories: getProviders(rec.GetDefaultClient()), + Steps: []resource.TestStep{ + { + Config: hclProvider() + hclDatasourceGlobalaccountResourceProvider("uut", + "AWS", + "tf_test_resource_provider"), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("data.btp_globalaccount_resource_provider.uut", "provider_type", "AWS"), + resource.TestCheckResourceAttr("data.btp_globalaccount_resource_provider.uut", "technical_name", "tf_test_resource_provider"), + resource.TestCheckResourceAttr("data.btp_globalaccount_resource_provider.uut", "id", "tf_test_resource_provider"), + resource.TestCheckResourceAttr("data.btp_globalaccount_resource_provider.uut", "display_name", "Test AWS Resource Provider"), + resource.TestCheckResourceAttr("data.btp_globalaccount_resource_provider.uut", "description", "Description of the resource provider"), + resource.TestCheckResourceAttr("data.btp_globalaccount_resource_provider.uut", "configuration", "{\"access_key_id\":\"AWSACCESSKEY\",\"secret_access_key\":\"AWSSECRETKEY\",\"vpc_id\":\"vpc-test\",\"region\":\"eu-central-1\"}"), + ), + }, + }, + }) + }) +} + +func hclDatasourceGlobalaccountResourceProvider(resourceName string, provider string, technicalName string) string { + return fmt.Sprintf(` +data "btp_globalaccount_resource_provider" "%s" { + provider_type = "%s" + technical_name = "%s" +}`, resourceName, provider, technicalName) +} diff --git a/internal/provider/datasource_globalaccount_resource_providers.go b/internal/provider/datasource_globalaccount_resource_providers.go index 0edcdf35..0e2fb63f 100644 --- a/internal/provider/datasource_globalaccount_resource_providers.go +++ b/internal/provider/datasource_globalaccount_resource_providers.go @@ -3,7 +3,6 @@ package provider import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-framework/datasource" "github.com/hashicorp/terraform-plugin-framework/datasource/schema" "github.com/hashicorp/terraform-plugin-framework/types" @@ -12,31 +11,32 @@ import ( ) func newGlobalaccountResourceProvidersDataSource() datasource.DataSource { - return &globalaccountGlobalaccountResourceProvidersDataSource{} + return &globalaccountResourceProvidersDataSource{} } -type globalaccountGlobalaccountResourceProvidersValue struct { - ResourceProvider types.String `tfsdk:"resource_provider"` - Id types.String `tfsdk:"id"` - DisplayName types.String `tfsdk:"display_name"` - Description types.String `tfsdk:"description"` +type globalaccountResourceProvidersValue struct { + Provider types.String `tfsdk:"provider_type"` + TechnicalName types.String `tfsdk:"technical_name"` + DisplayName types.String `tfsdk:"display_name"` + Description types.String `tfsdk:"description"` } -type globalaccountGlobalaccountResourceProvidersDataSourceConfig struct { +type globalaccountResourceProvidersDataSourceConfig struct { /* INPUT */ /* OUTPUT */ - Values []globalaccountGlobalaccountResourceProvidersValue `tfsdk:"values"` + Id types.String `tfsdk:"id"` + Values []globalaccountResourceProvidersValue `tfsdk:"values"` } -type globalaccountGlobalaccountResourceProvidersDataSource struct { +type globalaccountResourceProvidersDataSource struct { cli *btpcli.ClientFacade } -func (ds *globalaccountGlobalaccountResourceProvidersDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { +func (ds *globalaccountResourceProvidersDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { resp.TypeName = fmt.Sprintf("%s_globalaccount_resource_providers", req.ProviderTypeName) } -func (ds *globalaccountGlobalaccountResourceProvidersDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, _ *datasource.ConfigureResponse) { +func (ds *globalaccountResourceProvidersDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, _ *datasource.ConfigureResponse) { if req.ProviderData == nil { return } @@ -44,7 +44,7 @@ func (ds *globalaccountGlobalaccountResourceProvidersDataSource) Configure(_ con ds.cli = req.ProviderData.(*btpcli.ClientFacade) } -func (ds *globalaccountGlobalaccountResourceProvidersDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) { +func (ds *globalaccountResourceProvidersDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) { resp.Schema = schema.Schema{ MarkdownDescription: `Lists all the resource provider instances in a global account. @@ -54,18 +54,23 @@ You must be assigned to the global account admin or viewer role. __Further documentation:__ `, Attributes: map[string]schema.Attribute{ + "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, + }, "values": schema.ListNestedAttribute{ NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ - "resource_provider": schema.StringAttribute{ - MarkdownDescription: "The provider of the requested resource. Possible values are: \n" + + "provider_type": schema.StringAttribute{ + MarkdownDescription: "The cloud vendor from which to consume services through your subscribed account. Possible values are: \n" + getFormattedValueAsTableRow("value", "description") + getFormattedValueAsTableRow("---", "---") + getFormattedValueAsTableRow("`AWS`", "Amazon Web Services") + getFormattedValueAsTableRow("`AZURE`", "Microsoft Azure"), Computed: true, }, - "id": schema.StringAttribute{ + "technical_name": schema.StringAttribute{ MarkdownDescription: "The unique technical name of the resource provider.", Computed: true, }, @@ -85,8 +90,8 @@ __Further documentation:__ } } -func (ds *globalaccountGlobalaccountResourceProvidersDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { - var data globalaccountGlobalaccountResourceProvidersDataSourceConfig +func (ds *globalaccountResourceProvidersDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { + var data globalaccountResourceProvidersDataSourceConfig diags := req.Config.Get(ctx, &data) @@ -101,15 +106,18 @@ func (ds *globalaccountGlobalaccountResourceProvidersDataSource) Read(ctx contex return } - data.Values = []globalaccountGlobalaccountResourceProvidersValue{} + data.Id = types.StringValue(ds.cli.GetGlobalAccountSubdomain()) + data.Values = []globalaccountResourceProvidersValue{} for _, provider := range cliRes { - data.Values = append(data.Values, globalaccountGlobalaccountResourceProvidersValue{ - ResourceProvider: types.StringValue(provider.ResourceProvider), - Id: types.StringValue(provider.ResourceTechnicalName), - DisplayName: types.StringValue(provider.DisplayName), - Description: types.StringValue(provider.Description), - }) + resourceProvider := globalaccountResourceProvidersValue{ + Provider: types.StringValue(provider.ResourceProvider), + TechnicalName: types.StringValue(provider.TechnicalName), + DisplayName: types.StringValue(provider.DisplayName), + Description: types.StringValue(provider.Description), + } + + data.Values = append(data.Values, resourceProvider) } diags = resp.State.Set(ctx, &data) diff --git a/internal/provider/datasource_globalaccount_resource_providers_test.go b/internal/provider/datasource_globalaccount_resource_providers_test.go new file mode 100644 index 00000000..492f3e4b --- /dev/null +++ b/internal/provider/datasource_globalaccount_resource_providers_test.go @@ -0,0 +1,37 @@ +package provider + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" +) + +func TestDataSourceGlobalaccountResourceProviders(t *testing.T) { + t.Parallel() + t.Run("happy path", func(t *testing.T) { + rec := setupVCR(t, "fixtures/datasource_globalaccount_resource_providers") + defer stopQuietly(rec) + + resource.Test(t, resource.TestCase{ + IsUnitTest: true, + ProtoV6ProviderFactories: getProviders(rec.GetDefaultClient()), + Steps: []resource.TestStep{ + { + Config: hclProvider() + hclDatasourceGlobalaccountResourceProviders("uut"), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("data.btp_globalaccount_resource_providers.uut", "values.#", "1"), + resource.TestCheckResourceAttr("data.btp_globalaccount_resource_providers.uut", "values.0.provider_type", "AWS"), + resource.TestCheckResourceAttr("data.btp_globalaccount_resource_providers.uut", "values.0.technical_name", "tf_test_resource_provider"), + resource.TestCheckResourceAttr("data.btp_globalaccount_resource_providers.uut", "values.0.display_name", "Test AWS Resource Provider"), + resource.TestCheckResourceAttr("data.btp_globalaccount_resource_providers.uut", "values.0.description", "Description of the resource provider"), + ), + }, + }, + }) + }) +} + +func hclDatasourceGlobalaccountResourceProviders(resourceName string) string { + return fmt.Sprintf(`data "btp_globalaccount_resource_providers" "%s" {}`, resourceName) +} diff --git a/internal/provider/fixtures/datasource_globalaccount_resource_provider.yaml b/internal/provider/fixtures/datasource_globalaccount_resource_provider.yaml new file mode 100644 index 00000000..2e8299e5 --- /dev/null +++ b/internal/provider/fixtures/datasource_globalaccount_resource_provider.yaml @@ -0,0 +1,745 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 127 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"customIdp":"","subdomain":"terraformintcanary","userName":"john.doe@int.test","password":"redacted"} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - 9e17c379-8d1f-a63b-de70-a373fdfa2ca0 + X-Cpcli-Format: + - json + url: https://cpcli.cf.sap.hana.ondemand.com/login/v2.38.0 + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 162 + uncompressed: false + body: '{"issuer":"accounts.sap.com","refreshToken":"redacted","user":"john.doe@int.test","mail":"john.doe@int.test"}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Length: + - "162" + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 08:32:55 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - 05c3fed1-13b4-426b-6341-b799b229f552 + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 756.564162ms + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 116 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"paramValues":{"globalAccount":"terraformintcanary","provider":"AWS","technicalName":"tf_test_resource_provider"}} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - ed94c174-7092-ae21-c099-a8b07854d1ab + X-Cpcli-Customidp: + - "" + X-Cpcli-Format: + - json + X-Cpcli-Refreshtoken: + - redacted + X-Cpcli-Subdomain: + - terraformintcanary + url: https://cpcli.cf.sap.hana.ondemand.com/command/v2.38.0/accounts/resource-provider?get + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"technicalName":"tf_test_resource_provider","displayName":"Test AWS Resource Provider","description":"Description of the resource provider","resourceType":"IAAS_ACCOUNT","resourceProvider":"AWS","additionalInfo":{"access_key_id":"AWSACCESSKEY","secret_access_key":"AWSSECRETKEY","vpc_id":"vpc-test","region":"eu-central-1"}}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 08:32:57 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Cpcli-Backend-Mediatype: + - application/json;charset=UTF-8 + X-Cpcli-Backend-Status: + - "200" + X-Cpcli-Refreshtoken: + - redacted + X-Cpcli-Replacementrefreshtoken: + - redacted + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - 48a8215b-e7d7-4a20-473d-0f3348248c5c + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 1.432374514s + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 127 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"customIdp":"","subdomain":"terraformintcanary","userName":"john.doe@int.test","password":"redacted"} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - ea76d091-1db2-3d95-c212-4de2a1aceb24 + X-Cpcli-Format: + - json + url: https://cpcli.cf.sap.hana.ondemand.com/login/v2.38.0 + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 162 + uncompressed: false + body: '{"issuer":"accounts.sap.com","refreshToken":"redacted","user":"john.doe@int.test","mail":"john.doe@int.test"}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Length: + - "162" + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 08:32:57 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - ff2d2b31-29a1-457e-56bb-b73657d93ed2 + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 362.731854ms + - id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 116 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"paramValues":{"globalAccount":"terraformintcanary","provider":"AWS","technicalName":"tf_test_resource_provider"}} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - fd007640-82c7-3070-a5e0-e7e05c7c5b5f + X-Cpcli-Customidp: + - "" + X-Cpcli-Format: + - json + X-Cpcli-Refreshtoken: + - redacted + X-Cpcli-Subdomain: + - terraformintcanary + url: https://cpcli.cf.sap.hana.ondemand.com/command/v2.38.0/accounts/resource-provider?get + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"technicalName":"tf_test_resource_provider","displayName":"Test AWS Resource Provider","description":"Description of the resource provider","resourceType":"IAAS_ACCOUNT","resourceProvider":"AWS","additionalInfo":{"access_key_id":"AWSACCESSKEY","secret_access_key":"AWSSECRETKEY","vpc_id":"vpc-test","region":"eu-central-1"}}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 08:32:58 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Cpcli-Backend-Mediatype: + - application/json;charset=UTF-8 + X-Cpcli-Backend-Status: + - "200" + X-Cpcli-Refreshtoken: + - redacted + X-Cpcli-Replacementrefreshtoken: + - redacted + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - 2a2c987f-f807-4c2c-655f-132291738926 + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 605.96807ms + - id: 4 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 127 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"customIdp":"","subdomain":"terraformintcanary","userName":"john.doe@int.test","password":"redacted"} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - cf040d72-9af2-e09a-bfef-23c6bbbd90af + X-Cpcli-Format: + - json + url: https://cpcli.cf.sap.hana.ondemand.com/login/v2.38.0 + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 162 + uncompressed: false + body: '{"issuer":"accounts.sap.com","refreshToken":"redacted","user":"john.doe@int.test","mail":"john.doe@int.test"}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Length: + - "162" + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 08:32:59 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - 0fc4263a-c059-47bb-4590-63484a7cad16 + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 489.406589ms + - id: 5 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 116 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"paramValues":{"globalAccount":"terraformintcanary","provider":"AWS","technicalName":"tf_test_resource_provider"}} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - 90619502-5562-2dca-d0d1-1e567ce5d6b8 + X-Cpcli-Customidp: + - "" + X-Cpcli-Format: + - json + X-Cpcli-Refreshtoken: + - redacted + X-Cpcli-Subdomain: + - terraformintcanary + url: https://cpcli.cf.sap.hana.ondemand.com/command/v2.38.0/accounts/resource-provider?get + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"technicalName":"tf_test_resource_provider","displayName":"Test AWS Resource Provider","description":"Description of the resource provider","resourceType":"IAAS_ACCOUNT","resourceProvider":"AWS","additionalInfo":{"access_key_id":"AWSACCESSKEY","secret_access_key":"AWSSECRETKEY","vpc_id":"vpc-test","region":"eu-central-1"}}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 08:32:59 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Cpcli-Backend-Mediatype: + - application/json;charset=UTF-8 + X-Cpcli-Backend-Status: + - "200" + X-Cpcli-Refreshtoken: + - redacted + X-Cpcli-Replacementrefreshtoken: + - redacted + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - add72fd3-39b7-4d11-5e98-6350cff6e028 + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 222.862249ms + - id: 6 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 127 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"customIdp":"","subdomain":"terraformintcanary","userName":"john.doe@int.test","password":"redacted"} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - a36f1165-233e-84b1-7da9-d1ec1fcd9dda + X-Cpcli-Format: + - json + url: https://cpcli.cf.sap.hana.ondemand.com/login/v2.38.0 + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 162 + uncompressed: false + body: '{"issuer":"accounts.sap.com","refreshToken":"redacted","user":"john.doe@int.test","mail":"john.doe@int.test"}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Length: + - "162" + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 08:32:59 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - ea76223f-b14d-429f-6239-5902076e2abe + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 323.159833ms + - id: 7 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 116 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"paramValues":{"globalAccount":"terraformintcanary","provider":"AWS","technicalName":"tf_test_resource_provider"}} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - 37294895-2940-b157-bc46-9ee540b8e746 + X-Cpcli-Customidp: + - "" + X-Cpcli-Format: + - json + X-Cpcli-Refreshtoken: + - redacted + X-Cpcli-Subdomain: + - terraformintcanary + url: https://cpcli.cf.sap.hana.ondemand.com/command/v2.38.0/accounts/resource-provider?get + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"technicalName":"tf_test_resource_provider","displayName":"Test AWS Resource Provider","description":"Description of the resource provider","resourceType":"IAAS_ACCOUNT","resourceProvider":"AWS","additionalInfo":{"access_key_id":"AWSACCESSKEY","secret_access_key":"AWSSECRETKEY","vpc_id":"vpc-test","region":"eu-central-1"}}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 08:33:01 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Cpcli-Backend-Mediatype: + - application/json;charset=UTF-8 + X-Cpcli-Backend-Status: + - "200" + X-Cpcli-Refreshtoken: + - redacted + X-Cpcli-Replacementrefreshtoken: + - redacted + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - b8549484-c39c-4d9e-5380-f7cd30028849 + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 1.47505405s + - id: 8 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 127 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"customIdp":"","subdomain":"terraformintcanary","userName":"john.doe@int.test","password":"redacted"} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - cdd19172-5892-00a0-5ad6-c1cb9c183796 + X-Cpcli-Format: + - json + url: https://cpcli.cf.sap.hana.ondemand.com/login/v2.38.0 + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 162 + uncompressed: false + body: '{"issuer":"accounts.sap.com","refreshToken":"redacted","user":"john.doe@int.test","mail":"john.doe@int.test"}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Length: + - "162" + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 08:33:01 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - 9098cec3-ee30-4e33-7d84-95aa31e1b230 + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 218.350343ms + - id: 9 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 116 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"paramValues":{"globalAccount":"terraformintcanary","provider":"AWS","technicalName":"tf_test_resource_provider"}} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - 9d5c426b-9761-64d6-9c34-bfd2424b5f86 + X-Cpcli-Customidp: + - "" + X-Cpcli-Format: + - json + X-Cpcli-Refreshtoken: + - redacted + X-Cpcli-Subdomain: + - terraformintcanary + url: https://cpcli.cf.sap.hana.ondemand.com/command/v2.38.0/accounts/resource-provider?get + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"technicalName":"tf_test_resource_provider","displayName":"Test AWS Resource Provider","description":"Description of the resource provider","resourceType":"IAAS_ACCOUNT","resourceProvider":"AWS","additionalInfo":{"access_key_id":"AWSACCESSKEY","secret_access_key":"AWSSECRETKEY","vpc_id":"vpc-test","region":"eu-central-1"}}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 08:33:02 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Cpcli-Backend-Mediatype: + - application/json;charset=UTF-8 + X-Cpcli-Backend-Status: + - "200" + X-Cpcli-Refreshtoken: + - redacted + X-Cpcli-Replacementrefreshtoken: + - redacted + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - fb0b8d5d-f002-4008-4dc9-94c3c4ed090e + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 666.897352ms + - id: 10 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 127 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"customIdp":"","subdomain":"terraformintcanary","userName":"john.doe@int.test","password":"redacted"} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - f9d80e76-cb8e-6591-0853-bc26937ca6d2 + X-Cpcli-Format: + - json + url: https://cpcli.cf.sap.hana.ondemand.com/login/v2.38.0 + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 162 + uncompressed: false + body: '{"issuer":"accounts.sap.com","refreshToken":"redacted","user":"john.doe@int.test","mail":"john.doe@int.test"}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Length: + - "162" + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 08:33:02 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - f8ff59e7-3e44-4e9d-775e-c46bde25c1ff + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 305.199616ms diff --git a/internal/provider/fixtures/datasource_globalaccount_resource_providers.yaml b/internal/provider/fixtures/datasource_globalaccount_resource_providers.yaml new file mode 100644 index 00000000..1ef7069f --- /dev/null +++ b/internal/provider/fixtures/datasource_globalaccount_resource_providers.yaml @@ -0,0 +1,745 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 127 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"customIdp":"","subdomain":"terraformintcanary","userName":"john.doe@int.test","password":"redacted"} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - bf3abdf9-e910-d78b-a78c-39f7a80216da + X-Cpcli-Format: + - json + url: https://cpcli.cf.sap.hana.ondemand.com/login/v2.38.0 + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 162 + uncompressed: false + body: '{"issuer":"accounts.sap.com","refreshToken":"redacted","user":"john.doe@int.test","mail":"john.doe@int.test"}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Length: + - "162" + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 08:13:54 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - 2b34aa5f-9224-43d0-7489-b87d5a8b7b57 + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 627.819952ms + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 55 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"paramValues":{"globalAccount":"terraformintcanary"}} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - 0d7474e6-702e-4b28-04dd-79b125333aac + X-Cpcli-Customidp: + - "" + X-Cpcli-Format: + - json + X-Cpcli-Refreshtoken: + - redacted + X-Cpcli-Subdomain: + - terraformintcanary + url: https://cpcli.cf.sap.hana.ondemand.com/command/v2.38.0/accounts/resource-provider?list + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '[{"technicalName":"tf_test_resource_provider","displayName":"Test AWS Resource Provider","description":"Description of the resource provider","resourceType":"IAAS_ACCOUNT","resourceProvider":"AWS"}]' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 08:13:54 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Cpcli-Backend-Mediatype: + - application/json;charset=UTF-8 + X-Cpcli-Backend-Status: + - "200" + X-Cpcli-Refreshtoken: + - redacted + X-Cpcli-Replacementrefreshtoken: + - redacted + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - ebe6c9d7-eaa9-4584-7fe6-2f79820a3a63 + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 330.961247ms + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 127 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"customIdp":"","subdomain":"terraformintcanary","userName":"john.doe@int.test","password":"redacted"} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - f9229b55-9c79-5cf7-095e-ae7ef4cfd221 + X-Cpcli-Format: + - json + url: https://cpcli.cf.sap.hana.ondemand.com/login/v2.38.0 + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 162 + uncompressed: false + body: '{"issuer":"accounts.sap.com","refreshToken":"redacted","user":"john.doe@int.test","mail":"john.doe@int.test"}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Length: + - "162" + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 08:13:55 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - 06d3c383-962d-43d5-4c2d-60e32efd69b3 + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 444.131455ms + - id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 55 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"paramValues":{"globalAccount":"terraformintcanary"}} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - 594f754d-42f8-8941-11f1-46b4912ac32f + X-Cpcli-Customidp: + - "" + X-Cpcli-Format: + - json + X-Cpcli-Refreshtoken: + - redacted + X-Cpcli-Subdomain: + - terraformintcanary + url: https://cpcli.cf.sap.hana.ondemand.com/command/v2.38.0/accounts/resource-provider?list + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '[{"technicalName":"tf_test_resource_provider","displayName":"Test AWS Resource Provider","description":"Description of the resource provider","resourceType":"IAAS_ACCOUNT","resourceProvider":"AWS"}]' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 08:13:55 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Cpcli-Backend-Mediatype: + - application/json;charset=UTF-8 + X-Cpcli-Backend-Status: + - "200" + X-Cpcli-Refreshtoken: + - redacted + X-Cpcli-Replacementrefreshtoken: + - redacted + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - 37b322a7-df36-4c6b-50d8-a42f9af94e73 + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 275.593162ms + - id: 4 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 127 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"customIdp":"","subdomain":"terraformintcanary","userName":"john.doe@int.test","password":"redacted"} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - 0bb695ac-f3be-2818-7709-fdd1d09d59b9 + X-Cpcli-Format: + - json + url: https://cpcli.cf.sap.hana.ondemand.com/login/v2.38.0 + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 162 + uncompressed: false + body: '{"issuer":"accounts.sap.com","refreshToken":"redacted","user":"john.doe@int.test","mail":"john.doe@int.test"}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Length: + - "162" + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 08:13:56 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - 8072ba07-347f-4eb5-4ed7-11a73c7e45ab + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 412.208827ms + - id: 5 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 55 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"paramValues":{"globalAccount":"terraformintcanary"}} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - 6e59e260-009b-1b89-3f5e-d63b4491f499 + X-Cpcli-Customidp: + - "" + X-Cpcli-Format: + - json + X-Cpcli-Refreshtoken: + - redacted + X-Cpcli-Subdomain: + - terraformintcanary + url: https://cpcli.cf.sap.hana.ondemand.com/command/v2.38.0/accounts/resource-provider?list + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '[{"technicalName":"tf_test_resource_provider","displayName":"Test AWS Resource Provider","description":"Description of the resource provider","resourceType":"IAAS_ACCOUNT","resourceProvider":"AWS"}]' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 08:13:56 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Cpcli-Backend-Mediatype: + - application/json;charset=UTF-8 + X-Cpcli-Backend-Status: + - "200" + X-Cpcli-Refreshtoken: + - redacted + X-Cpcli-Replacementrefreshtoken: + - redacted + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - 075deb54-0076-489d-4d9d-5699fa791024 + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 323.824152ms + - id: 6 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 127 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"customIdp":"","subdomain":"terraformintcanary","userName":"john.doe@int.test","password":"redacted"} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - 4f8e4904-84b5-8e66-e1ba-62df818378ec + X-Cpcli-Format: + - json + url: https://cpcli.cf.sap.hana.ondemand.com/login/v2.38.0 + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 162 + uncompressed: false + body: '{"issuer":"accounts.sap.com","refreshToken":"redacted","user":"john.doe@int.test","mail":"john.doe@int.test"}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Length: + - "162" + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 08:13:56 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - 50a45348-e66f-4151-5c85-c3c08f98012d + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 243.488269ms + - id: 7 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 55 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"paramValues":{"globalAccount":"terraformintcanary"}} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - 9b7cb460-ebc5-6aa4-7f7b-1c7a7e896f9c + X-Cpcli-Customidp: + - "" + X-Cpcli-Format: + - json + X-Cpcli-Refreshtoken: + - redacted + X-Cpcli-Subdomain: + - terraformintcanary + url: https://cpcli.cf.sap.hana.ondemand.com/command/v2.38.0/accounts/resource-provider?list + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '[{"technicalName":"tf_test_resource_provider","displayName":"Test AWS Resource Provider","description":"Description of the resource provider","resourceType":"IAAS_ACCOUNT","resourceProvider":"AWS"}]' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 08:13:57 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Cpcli-Backend-Mediatype: + - application/json;charset=UTF-8 + X-Cpcli-Backend-Status: + - "200" + X-Cpcli-Refreshtoken: + - redacted + X-Cpcli-Replacementrefreshtoken: + - redacted + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - 15ae09b3-a7b9-4bba-7a3c-2258419e65e3 + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 231.832703ms + - id: 8 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 127 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"customIdp":"","subdomain":"terraformintcanary","userName":"john.doe@int.test","password":"redacted"} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - 5e708789-1d0c-9457-e1c4-fc5e0e11d352 + X-Cpcli-Format: + - json + url: https://cpcli.cf.sap.hana.ondemand.com/login/v2.38.0 + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 162 + uncompressed: false + body: '{"issuer":"accounts.sap.com","refreshToken":"redacted","user":"john.doe@int.test","mail":"john.doe@int.test"}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Length: + - "162" + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 08:13:57 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - 4dfcbca9-2316-4403-6b06-088b249d9cfe + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 239.245051ms + - id: 9 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 55 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"paramValues":{"globalAccount":"terraformintcanary"}} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - 52bd3a28-c8d5-6ff8-b857-808020035996 + X-Cpcli-Customidp: + - "" + X-Cpcli-Format: + - json + X-Cpcli-Refreshtoken: + - redacted + X-Cpcli-Subdomain: + - terraformintcanary + url: https://cpcli.cf.sap.hana.ondemand.com/command/v2.38.0/accounts/resource-provider?list + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '[{"technicalName":"tf_test_resource_provider","displayName":"Test AWS Resource Provider","description":"Description of the resource provider","resourceType":"IAAS_ACCOUNT","resourceProvider":"AWS"}]' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 08:13:57 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Cpcli-Backend-Mediatype: + - application/json;charset=UTF-8 + X-Cpcli-Backend-Status: + - "200" + X-Cpcli-Refreshtoken: + - redacted + X-Cpcli-Replacementrefreshtoken: + - redacted + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - db3ccdc5-4eac-419f-44a5-42c00f3119d3 + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 461.031097ms + - id: 10 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 127 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"customIdp":"","subdomain":"terraformintcanary","userName":"john.doe@int.test","password":"redacted"} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - 0a5509ad-ad19-dc3e-7415-e8e2391636e9 + X-Cpcli-Format: + - json + url: https://cpcli.cf.sap.hana.ondemand.com/login/v2.38.0 + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 162 + uncompressed: false + body: '{"issuer":"accounts.sap.com","refreshToken":"redacted","user":"john.doe@int.test","mail":"john.doe@int.test"}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Length: + - "162" + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 08:13:58 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - 5952c80f-3544-4f74-7619-7fb2591a0eda + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 310.444823ms diff --git a/internal/provider/fixtures/resource_globalaccount_resource_provider.create.yaml b/internal/provider/fixtures/resource_globalaccount_resource_provider.create.yaml new file mode 100644 index 00000000..2ffecadc --- /dev/null +++ b/internal/provider/fixtures/resource_globalaccount_resource_provider.create.yaml @@ -0,0 +1,1389 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 127 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"customIdp":"","subdomain":"terraformintcanary","userName":"john.doe@int.test","password":"redacted"} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - 48f3f8ae-5dbd-07c5-99ab-7570028cebb4 + X-Cpcli-Format: + - json + url: https://cpcli.cf.sap.hana.ondemand.com/login/v2.38.0 + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 162 + uncompressed: false + body: '{"issuer":"accounts.sap.com","refreshToken":"redacted","user":"john.doe@int.test","mail":"john.doe@int.test"}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Length: + - "162" + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 09:44:15 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - c1a89ddb-9251-4ac9-7e8e-c7f92e861919 + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 502.996992ms + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 127 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"customIdp":"","subdomain":"terraformintcanary","userName":"john.doe@int.test","password":"redacted"} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - 30a6e13b-be82-9b07-b87d-d823464f18d9 + X-Cpcli-Format: + - json + url: https://cpcli.cf.sap.hana.ondemand.com/login/v2.38.0 + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 162 + uncompressed: false + body: '{"issuer":"accounts.sap.com","refreshToken":"redacted","user":"john.doe@int.test","mail":"john.doe@int.test"}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Length: + - "162" + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 09:44:15 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - e3909a1a-c0f5-45c7-56ce-861936b2f35b + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 312.430862ms + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 127 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"customIdp":"","subdomain":"terraformintcanary","userName":"john.doe@int.test","password":"redacted"} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - 2c77eb4e-e3c2-5510-fc12-5c1550b75256 + X-Cpcli-Format: + - json + url: https://cpcli.cf.sap.hana.ondemand.com/login/v2.38.0 + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 162 + uncompressed: false + body: '{"issuer":"accounts.sap.com","refreshToken":"redacted","user":"john.doe@int.test","mail":"john.doe@int.test"}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Length: + - "162" + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 09:44:16 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - f376f59c-c9e5-4a0d-4338-184a35f4491a + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 385.831235ms + - id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 337 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"paramValues":{"configurationInfo":"{\"access_key_id\":\"AWSACCESSKEY\",\"secret_access_key\":\"AWSSECRETKEY\",\"vpc_id\":\"vpc-test\",\"region\":\"eu-central-1\"}","description":"My description","displayName":"My AWS Resource Provider","globalAccount":"terraformintcanary","provider":"AWS","technicalName":"my_aws_resource_provider"}} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - 84cb4b5e-95a6-fb06-7990-d9f51615ffec + X-Cpcli-Customidp: + - "" + X-Cpcli-Format: + - json + X-Cpcli-Refreshtoken: + - redacted + X-Cpcli-Subdomain: + - terraformintcanary + url: https://cpcli.cf.sap.hana.ondemand.com/command/v2.38.0/accounts/resource-provider?create + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"technicalName":"my_aws_resource_provider","displayName":"My AWS Resource Provider","description":"My description","resourceType":"IAAS_ACCOUNT","resourceProvider":"AWS","additionalInfo":{"access_key_id":"AWSACCESSKEY","secret_access_key":"AWSSECRETKEY","vpc_id":"vpc-test","region":"eu-central-1"}}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 09:44:17 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Cpcli-Backend-Mediatype: + - application/json;charset=UTF-8 + X-Cpcli-Backend-Status: + - "200" + X-Cpcli-Refreshtoken: + - redacted + X-Cpcli-Replacementrefreshtoken: + - redacted + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - c305f671-e066-4cda-71a6-715683c73e7e + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 476.858802ms + - id: 4 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 127 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"customIdp":"","subdomain":"terraformintcanary","userName":"john.doe@int.test","password":"redacted"} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - 96dd83ba-ced8-b187-232b-7cf02f37d7b7 + X-Cpcli-Format: + - json + url: https://cpcli.cf.sap.hana.ondemand.com/login/v2.38.0 + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 162 + uncompressed: false + body: '{"issuer":"accounts.sap.com","refreshToken":"redacted","user":"john.doe@int.test","mail":"john.doe@int.test"}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Length: + - "162" + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 09:44:17 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - 31e02521-74ca-4110-7086-111800aad94e + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 405.055234ms + - id: 5 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 127 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"customIdp":"","subdomain":"terraformintcanary","userName":"john.doe@int.test","password":"redacted"} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - e03fc310-fd61-5280-230b-6c4bd785fd12 + X-Cpcli-Format: + - json + url: https://cpcli.cf.sap.hana.ondemand.com/login/v2.38.0 + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 162 + uncompressed: false + body: '{"issuer":"accounts.sap.com","refreshToken":"redacted","user":"john.doe@int.test","mail":"john.doe@int.test"}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Length: + - "162" + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 09:44:18 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - 6680e845-eb5d-41b0-6756-58495bcc314b + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 231.972414ms + - id: 6 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 115 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"paramValues":{"globalAccount":"terraformintcanary","provider":"AWS","technicalName":"my_aws_resource_provider"}} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - 4ce91bbe-a81a-d737-a82a-dd75da967a8b + X-Cpcli-Customidp: + - "" + X-Cpcli-Format: + - json + X-Cpcli-Refreshtoken: + - redacted + X-Cpcli-Subdomain: + - terraformintcanary + url: https://cpcli.cf.sap.hana.ondemand.com/command/v2.38.0/accounts/resource-provider?get + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"technicalName":"my_aws_resource_provider","displayName":"My AWS Resource Provider","description":"My description","resourceType":"IAAS_ACCOUNT","resourceProvider":"AWS","additionalInfo":{"access_key_id":"AWSACCESSKEY","secret_access_key":"AWSSECRETKEY","vpc_id":"vpc-test","region":"eu-central-1"}}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 09:44:18 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Cpcli-Backend-Mediatype: + - application/json;charset=UTF-8 + X-Cpcli-Backend-Status: + - "200" + X-Cpcli-Refreshtoken: + - redacted + X-Cpcli-Replacementrefreshtoken: + - redacted + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - 0a20a0ea-939c-4fbf-6273-e5768686f6d6 + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 383.029163ms + - id: 7 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 127 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"customIdp":"","subdomain":"terraformintcanary","userName":"john.doe@int.test","password":"redacted"} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - d8b7ba9e-b9a7-c62c-def9-93228c3304f1 + X-Cpcli-Format: + - json + url: https://cpcli.cf.sap.hana.ondemand.com/login/v2.38.0 + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 162 + uncompressed: false + body: '{"issuer":"accounts.sap.com","refreshToken":"redacted","user":"john.doe@int.test","mail":"john.doe@int.test"}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Length: + - "162" + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 09:44:18 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - a21f69d8-e7c9-4e34-4ac5-8f2002bffd32 + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 286.874784ms + - id: 8 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 127 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"customIdp":"","subdomain":"terraformintcanary","userName":"john.doe@int.test","password":"redacted"} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - 7f8bcfff-cb69-cfa6-7607-f154a33a600a + X-Cpcli-Format: + - json + url: https://cpcli.cf.sap.hana.ondemand.com/login/v2.38.0 + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 162 + uncompressed: false + body: '{"issuer":"accounts.sap.com","refreshToken":"redacted","user":"john.doe@int.test","mail":"john.doe@int.test"}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Length: + - "162" + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 09:44:19 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - 16a7f195-f2db-4856-600b-031a022039bd + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 251.587533ms + - id: 9 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 115 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"paramValues":{"globalAccount":"terraformintcanary","provider":"AWS","technicalName":"my_aws_resource_provider"}} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - f234eaf2-9419-e04f-5aff-aa27ad7e560b + X-Cpcli-Customidp: + - "" + X-Cpcli-Format: + - json + X-Cpcli-Refreshtoken: + - redacted + X-Cpcli-Subdomain: + - terraformintcanary + url: https://cpcli.cf.sap.hana.ondemand.com/command/v2.38.0/accounts/resource-provider?get + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"technicalName":"my_aws_resource_provider","displayName":"My AWS Resource Provider","description":"My description","resourceType":"IAAS_ACCOUNT","resourceProvider":"AWS","additionalInfo":{"access_key_id":"AWSACCESSKEY","secret_access_key":"AWSSECRETKEY","vpc_id":"vpc-test","region":"eu-central-1"}}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 09:44:19 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Cpcli-Backend-Mediatype: + - application/json;charset=UTF-8 + X-Cpcli-Backend-Status: + - "200" + X-Cpcli-Refreshtoken: + - redacted + X-Cpcli-Replacementrefreshtoken: + - redacted + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - 794e27c2-ab92-4304-7c44-b958ed131aa4 + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 277.665019ms + - id: 10 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 127 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"customIdp":"","subdomain":"terraformintcanary","userName":"john.doe@int.test","password":"redacted"} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - 603c7658-5e53-a79a-a5f3-3b586c7edb47 + X-Cpcli-Format: + - json + url: https://cpcli.cf.sap.hana.ondemand.com/login/v2.38.0 + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 162 + uncompressed: false + body: '{"issuer":"accounts.sap.com","refreshToken":"redacted","user":"john.doe@int.test","mail":"john.doe@int.test"}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Length: + - "162" + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 09:44:19 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - 087dd23c-dcd0-46fa-57e6-0ae7f3bdb590 + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 227.168997ms + - id: 11 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 127 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"customIdp":"","subdomain":"terraformintcanary","userName":"john.doe@int.test","password":"redacted"} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - 220b4764-3b77-2635-df11-21ee04e2a14a + X-Cpcli-Format: + - json + url: https://cpcli.cf.sap.hana.ondemand.com/login/v2.38.0 + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 162 + uncompressed: false + body: '{"issuer":"accounts.sap.com","refreshToken":"redacted","user":"john.doe@int.test","mail":"john.doe@int.test"}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Length: + - "162" + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 09:44:20 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - 43e77f4c-316a-4189-7b45-a3f8c2226901 + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 230.849149ms + - id: 12 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 132 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"paramValues":{"confirm":"true","globalAccount":"terraformintcanary","provider":"AWS","technicalName":"my_aws_resource_provider"}} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - 004049ae-0cca-4e78-3cf8-091077dcd089 + X-Cpcli-Customidp: + - "" + X-Cpcli-Format: + - json + X-Cpcli-Refreshtoken: + - redacted + X-Cpcli-Subdomain: + - terraformintcanary + url: https://cpcli.cf.sap.hana.ondemand.com/command/v2.38.0/accounts/resource-provider?delete + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: "null" + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 09:44:20 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Cpcli-Backend-Mediatype: + - application/json;charset=UTF-8 + X-Cpcli-Backend-Status: + - "200" + X-Cpcli-Refreshtoken: + - redacted + X-Cpcli-Replacementrefreshtoken: + - redacted + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - 2d5bb8c4-1ca4-4a6f-72b9-a5cdfc390d51 + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 614.941982ms + - id: 13 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 308 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"paramValues":{"configurationInfo":"{\"access_key_id\":\"AWSACCESSKEY\",\"secret_access_key\":\"AWSSECRETKEY\",\"vpc_id\":\"vpc-test\",\"region\":\"eu-central-1\"}","displayName":"Another Resource Provider","globalAccount":"terraformintcanary","provider":"AWS","technicalName":"another_resource_provider"}} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - 9f81a8f4-4022-9ac6-b7e7-212a1b09db3a + X-Cpcli-Customidp: + - "" + X-Cpcli-Format: + - json + X-Cpcli-Refreshtoken: + - redacted + X-Cpcli-Subdomain: + - terraformintcanary + url: https://cpcli.cf.sap.hana.ondemand.com/command/v2.38.0/accounts/resource-provider?create + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"technicalName":"another_resource_provider","displayName":"Another Resource Provider","resourceType":"IAAS_ACCOUNT","resourceProvider":"AWS","additionalInfo":{"access_key_id":"AWSACCESSKEY","secret_access_key":"AWSSECRETKEY","vpc_id":"vpc-test","region":"eu-central-1"}}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 09:44:21 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Cpcli-Backend-Mediatype: + - application/json;charset=UTF-8 + X-Cpcli-Backend-Status: + - "200" + X-Cpcli-Refreshtoken: + - redacted + X-Cpcli-Replacementrefreshtoken: + - redacted + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - 176bf1a5-9e70-441f-5e12-030ef211ff4b + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 580.650669ms + - id: 14 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 127 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"customIdp":"","subdomain":"terraformintcanary","userName":"john.doe@int.test","password":"redacted"} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - 572c9c09-a663-7cc6-ea13-8dc560b927fa + X-Cpcli-Format: + - json + url: https://cpcli.cf.sap.hana.ondemand.com/login/v2.38.0 + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 162 + uncompressed: false + body: '{"issuer":"accounts.sap.com","refreshToken":"redacted","user":"john.doe@int.test","mail":"john.doe@int.test"}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Length: + - "162" + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 09:44:22 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - b0ab1ded-a9f1-463b-6c53-e2620c92fbee + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 350.963786ms + - id: 15 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 127 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"customIdp":"","subdomain":"terraformintcanary","userName":"john.doe@int.test","password":"redacted"} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - 83803067-45a2-00eb-085c-faded184129a + X-Cpcli-Format: + - json + url: https://cpcli.cf.sap.hana.ondemand.com/login/v2.38.0 + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 162 + uncompressed: false + body: '{"issuer":"accounts.sap.com","refreshToken":"redacted","user":"john.doe@int.test","mail":"john.doe@int.test"}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Length: + - "162" + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 09:44:22 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - 3d313ec4-58f8-4990-7101-3cc3d8642784 + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 255.616381ms + - id: 16 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 116 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"paramValues":{"globalAccount":"terraformintcanary","provider":"AWS","technicalName":"another_resource_provider"}} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - b939da5d-91be-b181-ff33-ffd3ede38a20 + X-Cpcli-Customidp: + - "" + X-Cpcli-Format: + - json + X-Cpcli-Refreshtoken: + - redacted + X-Cpcli-Subdomain: + - terraformintcanary + url: https://cpcli.cf.sap.hana.ondemand.com/command/v2.38.0/accounts/resource-provider?get + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"technicalName":"another_resource_provider","displayName":"Another Resource Provider","resourceType":"IAAS_ACCOUNT","resourceProvider":"AWS","additionalInfo":{"access_key_id":"AWSACCESSKEY","secret_access_key":"AWSSECRETKEY","vpc_id":"vpc-test","region":"eu-central-1"}}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 09:44:22 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Cpcli-Backend-Mediatype: + - application/json;charset=UTF-8 + X-Cpcli-Backend-Status: + - "200" + X-Cpcli-Refreshtoken: + - redacted + X-Cpcli-Replacementrefreshtoken: + - redacted + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - 42651033-66ed-434f-4477-d22a290ef5d8 + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 228.530327ms + - id: 17 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 127 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"customIdp":"","subdomain":"terraformintcanary","userName":"john.doe@int.test","password":"redacted"} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - fa3b9382-9eef-460a-ab69-9770f5a74687 + X-Cpcli-Format: + - json + url: https://cpcli.cf.sap.hana.ondemand.com/login/v2.38.0 + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 162 + uncompressed: false + body: '{"issuer":"accounts.sap.com","refreshToken":"redacted","user":"john.doe@int.test","mail":"john.doe@int.test"}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Length: + - "162" + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 09:44:23 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - 0b4aca92-1712-4ee0-676f-eefca44e8afd + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 423.191495ms + - id: 18 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 127 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"customIdp":"","subdomain":"terraformintcanary","userName":"john.doe@int.test","password":"redacted"} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - 9bb68e18-4fd2-ac97-a6cc-0c7dfc8550e2 + X-Cpcli-Format: + - json + url: https://cpcli.cf.sap.hana.ondemand.com/login/v2.38.0 + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 162 + uncompressed: false + body: '{"issuer":"accounts.sap.com","refreshToken":"redacted","user":"john.doe@int.test","mail":"john.doe@int.test"}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Length: + - "162" + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 09:44:23 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - c5222c76-2ee8-47af-548f-a6945cd52dbf + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 250.171172ms + - id: 19 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 127 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"customIdp":"","subdomain":"terraformintcanary","userName":"john.doe@int.test","password":"redacted"} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - 6b8a11fd-6edb-cdd8-efbf-9c849afe3d37 + X-Cpcli-Format: + - json + url: https://cpcli.cf.sap.hana.ondemand.com/login/v2.38.0 + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 162 + uncompressed: false + body: '{"issuer":"accounts.sap.com","refreshToken":"redacted","user":"john.doe@int.test","mail":"john.doe@int.test"}' + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Length: + - "162" + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 09:44:23 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - c2c10b03-8f49-49e9-6c78-9a05b7b24643 + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 239.521059ms + - id: 20 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 133 + transfer_encoding: [] + trailer: {} + host: cpcli.cf.sap.hana.ondemand.com + remote_addr: "" + request_uri: "" + body: | + {"paramValues":{"confirm":"true","globalAccount":"terraformintcanary","provider":"AWS","technicalName":"another_resource_provider"}} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Terraform/1.5.0 terraform-provider-btp/dev + X-Correlationid: + - 7f02c253-5fc7-39d1-0db1-3cc50ab8c617 + X-Cpcli-Customidp: + - "" + X-Cpcli-Format: + - json + X-Cpcli-Refreshtoken: + - redacted + X-Cpcli-Subdomain: + - terraformintcanary + url: https://cpcli.cf.sap.hana.ondemand.com/command/v2.38.0/accounts/resource-provider?delete + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: "null" + headers: + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Content-Type: + - application/json + Date: + - Thu, 27 Jul 2023 09:44:24 GMT + Expires: + - "0" + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload; + X-Content-Type-Options: + - nosniff + X-Cpcli-Backend-Mediatype: + - application/json;charset=UTF-8 + X-Cpcli-Backend-Status: + - "200" + X-Cpcli-Refreshtoken: + - redacted + X-Cpcli-Replacementrefreshtoken: + - redacted + X-Frame-Options: + - DENY + X-Vcap-Request-Id: + - a0c7a635-d0a0-48bb-7ed8-69b1bd6e6fa7 + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 356.469115ms diff --git a/internal/provider/resource_globalaccount_resource_provider.go b/internal/provider/resource_globalaccount_resource_provider.go index 7e8ca1ba..f40258c5 100644 --- a/internal/provider/resource_globalaccount_resource_provider.go +++ b/internal/provider/resource_globalaccount_resource_provider.go @@ -51,33 +51,45 @@ __Tips:__ __Further documentation:__ `, Attributes: map[string]schema.Attribute{ - "resource_provider": schema.StringAttribute{ - MarkdownDescription: "Provider of the requested resource. Possible values are: \n" + + "provider_type": schema.StringAttribute{ + MarkdownDescription: "The cloud vendor from which to consume services through your subscribed account. Possible values are: \n" + getFormattedValueAsTableRow("value", "description") + getFormattedValueAsTableRow("---", "---") + getFormattedValueAsTableRow("`AWS`", "Amazon Web Services") + getFormattedValueAsTableRow("`AZURE`", "Microsoft Azure"), Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + }, }, - "id": schema.StringAttribute{ + "technical_name": schema.StringAttribute{ MarkdownDescription: "The unique technical name of the resource provider.", Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + }, + }, + "id": schema.StringAttribute{ + DeprecationMessage: "Use the `technical_name` attribute instead", + MarkdownDescription: "The unique technical name of the resource provider.", + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, }, "display_name": schema.StringAttribute{ MarkdownDescription: "The descriptive name of the resource provider.", - Computed: true, + Required: true, }, "description": schema.StringAttribute{ MarkdownDescription: "The description of the resource provider.", + Optional: true, Computed: true, }, - "parameters": schema.StringAttribute{ - MarkdownDescription: "Any relevant information about the resource provider that is not provided by other parameter values.", + "configuration": schema.StringAttribute{ + MarkdownDescription: "The configuration properties for the resource provider as required by the vendor.", Required: true, Sensitive: true, - PlanModifiers: []planmodifier.String{ - stringplanmodifier.RequiresReplace(), - }, Validators: []validator.String{ jsonvalidator.ValidJSON(), }, @@ -96,7 +108,7 @@ func (rs *resourceGlobalaccountProviderResource) Read(ctx context.Context, req r return } - cliRes, _, err := rs.cli.Accounts.ResourceProvider.Get(ctx, state.ResourceProvider.ValueString(), state.Id.ValueString()) + cliRes, _, err := rs.cli.Accounts.ResourceProvider.Get(ctx, state.Provider.ValueString(), state.TechnicalName.ValueString()) if err != nil { resp.Diagnostics.AddError("API Error Reading Resource Resource Provider (Global Account)", fmt.Sprintf("%s", err)) return @@ -118,21 +130,21 @@ func (rs *resourceGlobalaccountProviderResource) Create(ctx context.Context, req } cliRes, _, err := rs.cli.Accounts.ResourceProvider.Create(ctx, btpcli.GlobalaccountResourceProviderCreateInput{ - Provider: plan.ResourceProvider.ValueString(), - TechnicalName: plan.Id.ValueString(), - DisplayName: plan.DisplayName.ValueString(), - Description: plan.Description.ValueString(), - ConfigurationInfo: plan.Parameters.ValueString(), + Provider: plan.Provider.ValueString(), + TechnicalName: plan.TechnicalName.ValueString(), + DisplayName: plan.DisplayName.ValueString(), + Description: plan.Description.ValueString(), + Configuration: plan.Configuration.ValueString(), }) if err != nil { resp.Diagnostics.AddError("API Error Creating Resource Resource Provider (Global Account)", fmt.Sprintf("%s", err)) return } - plan, diags = globalaccountResourceProviderValueFrom(ctx, cliRes) + state, diags := globalaccountResourceProviderValueFrom(ctx, cliRes) resp.Diagnostics.Append(diags...) - diags = resp.State.Set(ctx, &plan) + diags = resp.State.Set(ctx, &state) resp.Diagnostics.Append(diags...) } @@ -168,7 +180,7 @@ func (rs *resourceGlobalaccountProviderResource) Delete(ctx context.Context, req return } - _, _, err := rs.cli.Accounts.ResourceProvider.Delete(ctx, state.ResourceProvider.ValueString(), state.Id.ValueString()) + _, _, err := rs.cli.Accounts.ResourceProvider.Delete(ctx, state.Provider.ValueString(), state.TechnicalName.ValueString()) if err != nil { resp.Diagnostics.AddError("API Error Deleting Resource Resource Provider (Global Account)", fmt.Sprintf("%s", err)) return diff --git a/internal/provider/resource_globalaccount_resource_provider_test.go b/internal/provider/resource_globalaccount_resource_provider_test.go new file mode 100644 index 00000000..f66043b3 --- /dev/null +++ b/internal/provider/resource_globalaccount_resource_provider_test.go @@ -0,0 +1,76 @@ +package provider + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" +) + +func TestResourceGlobalaccountResourceProvider(t *testing.T) { + t.Parallel() + t.Run("happy path - create", func(t *testing.T) { + rec := setupVCR(t, "fixtures/resource_globalaccount_resource_provider.create") + defer stopQuietly(rec) + + resource.Test(t, resource.TestCase{ + IsUnitTest: true, + ProtoV6ProviderFactories: getProviders(rec.GetDefaultClient()), + Steps: []resource.TestStep{ + { + Config: hclProvider() + hclResourceGlobalaccountResourceProvider("uut", + "AWS", + "my_aws_resource_provider", + "My AWS Resource Provider", + "My description", + "{\"access_key_id\":\"AWSACCESSKEY\",\"secret_access_key\":\"AWSSECRETKEY\",\"vpc_id\":\"vpc-test\",\"region\":\"eu-central-1\"}", + ), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("btp_globalaccount_resource_provider.uut", "provider_type", "AWS"), + resource.TestCheckResourceAttr("btp_globalaccount_resource_provider.uut", "technical_name", "my_aws_resource_provider"), + resource.TestCheckResourceAttr("btp_globalaccount_resource_provider.uut", "id", "my_aws_resource_provider"), + resource.TestCheckResourceAttr("btp_globalaccount_resource_provider.uut", "display_name", "My AWS Resource Provider"), + resource.TestCheckResourceAttr("btp_globalaccount_resource_provider.uut", "description", "My description"), + resource.TestCheckResourceAttr("btp_globalaccount_resource_provider.uut", "configuration", "{\"access_key_id\":\"AWSACCESSKEY\",\"secret_access_key\":\"AWSSECRETKEY\",\"vpc_id\":\"vpc-test\",\"region\":\"eu-central-1\"}"), + ), + }, + { + Config: hclProvider() + hclResourceGlobalaccountResourceProviderNoDesc("uut", + "AWS", + "another_resource_provider", + "Another Resource Provider", + "{\"access_key_id\":\"AWSACCESSKEY\",\"secret_access_key\":\"AWSSECRETKEY\",\"vpc_id\":\"vpc-test\",\"region\":\"eu-central-1\"}", + ), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("btp_globalaccount_resource_provider.uut", "provider_type", "AWS"), + resource.TestCheckResourceAttr("btp_globalaccount_resource_provider.uut", "technical_name", "another_resource_provider"), + resource.TestCheckResourceAttr("btp_globalaccount_resource_provider.uut", "display_name", "Another Resource Provider"), + resource.TestCheckResourceAttr("btp_globalaccount_resource_provider.uut", "configuration", "{\"access_key_id\":\"AWSACCESSKEY\",\"secret_access_key\":\"AWSSECRETKEY\",\"vpc_id\":\"vpc-test\",\"region\":\"eu-central-1\"}"), + ), + }, + }, + }) + }) + +} + +func hclResourceGlobalaccountResourceProvider(resourceName string, provider string, technicalName string, displayName string, description string, configuration string) string { + return fmt.Sprintf(` +resource "btp_globalaccount_resource_provider" "%s" { + provider_type = "%s" + technical_name = "%s" + display_name = "%s" + description = "%s" + configuration = %q +}`, resourceName, provider, technicalName, displayName, description, configuration) +} + +func hclResourceGlobalaccountResourceProviderNoDesc(resourceName string, provider string, technicalName string, displayName string, configuration string) string { + return fmt.Sprintf(` +resource "btp_globalaccount_resource_provider" "%s" { + provider_type = "%s" + technical_name = "%s" + display_name = "%s" + configuration = %q +}`, resourceName, provider, technicalName, displayName, configuration) +} diff --git a/internal/provider/type_globalaccount_resource_provider.go b/internal/provider/type_globalaccount_resource_provider.go index 2245e0da..27a921be 100644 --- a/internal/provider/type_globalaccount_resource_provider.go +++ b/internal/provider/type_globalaccount_resource_provider.go @@ -10,25 +10,27 @@ import ( ) type globalaccountResourceProviderType struct { - ResourceProvider types.String `tfsdk:"resource_provider"` - Id types.String `tfsdk:"id"` - DisplayName types.String `tfsdk:"display_name"` - Description types.String `tfsdk:"description"` - Parameters types.String `tfsdk:"parameters"` + Provider types.String `tfsdk:"provider_type"` + TechnicalName types.String `tfsdk:"technical_name"` + Id types.String `tfsdk:"id"` + DisplayName types.String `tfsdk:"display_name"` + Description types.String `tfsdk:"description"` + Configuration types.String `tfsdk:"configuration"` } func globalaccountResourceProviderValueFrom(ctx context.Context, value provisioning.ResourceProviderResponseObject) (globalaccountResourceProviderType, diag.Diagnostics) { resourceProvider := globalaccountResourceProviderType{ - ResourceProvider: types.StringValue(value.ResourceProvider), - Id: types.StringValue(value.ResourceTechnicalName), - DisplayName: types.StringValue(value.DisplayName), - Description: types.StringValue(value.Description), + Provider: types.StringValue(value.ResourceProvider), + TechnicalName: types.StringValue(value.TechnicalName), + Id: types.StringValue(value.TechnicalName), + DisplayName: types.StringValue(value.DisplayName), + Description: types.StringValue(value.Description), } if value.AdditionalInfo == nil { - resourceProvider.Parameters = types.StringNull() + resourceProvider.Configuration = types.StringNull() } else { - resourceProvider.Parameters = types.StringValue(string(*value.AdditionalInfo)) + resourceProvider.Configuration = types.StringValue(string(*value.AdditionalInfo)) } return resourceProvider, diag.Diagnostics{}