Skip to content

Commit

Permalink
Changed type of sns_topic_arns in the chatbot service to set
Browse files Browse the repository at this point in the history
  • Loading branch information
JvRok committed Oct 24, 2024
1 parent 46bd33c commit eac22f4
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions internal/service/chatbot/slack_channel_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,19 @@ import (
"github.com/aws/aws-sdk-go-v2/service/chatbot"
awstypes "github.com/aws/aws-sdk-go-v2/service/chatbot/types"
"github.com/hashicorp/terraform-plugin-framework-timeouts/resource/timeouts"
"github.com/hashicorp/terraform-plugin-framework-validators/setvalidator"
"github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
"github.com/hashicorp/terraform-plugin-framework/path"
"github.com/hashicorp/terraform-plugin-framework/resource"
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/booldefault"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/boolplanmodifier"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/listplanmodifier"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/setplanmodifier"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringdefault"
"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-log/tflog"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry"
Expand All @@ -30,6 +34,7 @@ import (
"github.com/hashicorp/terraform-provider-aws/internal/framework"
fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex"
fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types"
"github.com/hashicorp/terraform-provider-aws/internal/framework/validators"
tftags "github.com/hashicorp/terraform-provider-aws/internal/tags"
"github.com/hashicorp/terraform-provider-aws/internal/tfresource"
"github.com/hashicorp/terraform-provider-aws/names"
Expand Down Expand Up @@ -95,12 +100,20 @@ func (r *slackChannelConfigurationResource) Schema(ctx context.Context, request
"slack_team_name": schema.StringAttribute{
Computed: true,
},
"sns_topic_arns": schema.ListAttribute{
"sns_topic_arns": schema.SetAttribute{
CustomType: types.SetType{ElemType: types.StringType},
ElementType: types.StringType,
Optional: true,
Computed: true,
ElementType: types.StringType,
PlanModifiers: []planmodifier.List{
listplanmodifier.UseStateForUnknown(),
Validators: []validator.Set{
setvalidator.ValueStringsAre(
stringvalidator.Any(
validators.ARN(),
),
),
},
PlanModifiers: []planmodifier.Set{
setplanmodifier.UseStateForUnknown(),
},
},
names.AttrTags: tftags.TagsAttribute(),
Expand Down Expand Up @@ -407,7 +420,7 @@ type slackChannelConfigurationResourceModel struct {
SlackChannelName types.String `tfsdk:"slack_channel_name"`
SlackTeamID types.String `tfsdk:"slack_team_id"`
SlackTeamName types.String `tfsdk:"slack_team_name"`
SNSTopicARNs types.List `tfsdk:"sns_topic_arns"`
SNSTopicARNs types.Set `tfsdk:"sns_topic_arns"`
Tags tftags.Map `tfsdk:"tags"`
TagsAll tftags.Map `tfsdk:"tags_all"`
Timeouts timeouts.Value `tfsdk:"timeouts"`
Expand Down

0 comments on commit eac22f4

Please sign in to comment.