Skip to content

Commit

Permalink
fix: changed from basetype to types.StringPointerValue(nil) in import…
Browse files Browse the repository at this point in the history
… statement

Signed-off-by: Matthias Theuermann <[email protected]>
  • Loading branch information
mati007thm committed Jul 4, 2024
1 parent 02e136c commit 3ee5ab5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
5 changes: 2 additions & 3 deletions internal/provider/integration_aws_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
"github.com/hashicorp/terraform-plugin-framework/types"
"github.com/hashicorp/terraform-plugin-framework/types/basetypes"
mondoov1 "go.mondoo.com/mondoo-go"
)

Expand Down Expand Up @@ -295,11 +294,11 @@ func (r *integrationAwsResource) ImportState(ctx context.Context, req resource.I
Credential: integrationAwsCredentialModel{
Role: &roleCredentialModel{
RoleArn: types.StringValue(integration.ConfigurationOptions.HostedAwsConfigurationOptions.Role),
ExternalId: basetypes.NewStringNull(), // cannot be imported
ExternalId: types.StringPointerValue(nil), // cannot be imported
},
Key: &accessKeyCredentialModel{
AccessKey: types.StringValue(integration.ConfigurationOptions.HostedAwsConfigurationOptions.AccessKeyId),
SecretKey: basetypes.NewStringNull(), // cannot be imported
SecretKey: types.StringPointerValue(nil), // cannot be imported
},
},
}
Expand Down
3 changes: 1 addition & 2 deletions internal/provider/integration_azure_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
"github.com/hashicorp/terraform-plugin-framework/types"
"github.com/hashicorp/terraform-plugin-framework/types/basetypes"
mondoov1 "go.mondoo.com/mondoo-go"
)

Expand Down Expand Up @@ -311,7 +310,7 @@ func (r *integrationAzureResource) ImportState(ctx context.Context, req resource
SubscriptionAllowList: allowList,
SubscriptionDenyList: denyList,
Credential: integrationAzureCredentialModel{
PEMFile: basetypes.NewStringNull(),
PEMFile: types.StringPointerValue(nil),
},
ScanVms: types.BoolValue(integration.ConfigurationOptions.AzureConfigurationOptions.ScanVms),
}
Expand Down
3 changes: 1 addition & 2 deletions internal/provider/integration_gcp_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
"github.com/hashicorp/terraform-plugin-framework/types"
"github.com/hashicorp/terraform-plugin-framework/types/basetypes"
mondoov1 "go.mondoo.com/mondoo-go"
)

Expand Down Expand Up @@ -235,7 +234,7 @@ func (r *integrationGcpResource) ImportState(ctx context.Context, req resource.I
SpaceId: types.StringValue(strings.Split(integration.Mrn, "/")[len(strings.Split(integration.Mrn, "/"))-3]),
ProjectId: types.StringValue(integration.ConfigurationOptions.GcpConfigurationOptions.ProjectId),
Credential: integrationGcpCredentialModel{
PrivateKey: basetypes.NewStringNull(),
PrivateKey: types.StringPointerValue(nil),
},
}

Expand Down

0 comments on commit 3ee5ab5

Please sign in to comment.