diff --git a/internal/service/bedrockagent/agent.go b/internal/service/bedrockagent/agent.go index e74f1b13047..e9c0a7e719a 100644 --- a/internal/service/bedrockagent/agent.go +++ b/internal/service/bedrockagent/agent.go @@ -389,7 +389,7 @@ func (r *agentResource) Delete(ctx context.Context, request resource.DeleteReque agentID := data.ID.ValueString() _, err := conn.DeleteAgent(ctx, &bedrockagent.DeleteAgentInput{ - AgentId: fwflex.StringFromFramework(ctx, data.AgentID), + AgentId: aws.String(agentID), SkipResourceInUseCheck: fwflex.BoolValueFromFramework(ctx, data.SkipResourceInUseCheck), }) diff --git a/internal/service/bedrockagent/sweep.go b/internal/service/bedrockagent/sweep.go index 7734ec02792..bd5cac5e1f0 100644 --- a/internal/service/bedrockagent/sweep.go +++ b/internal/service/bedrockagent/sweep.go @@ -18,7 +18,7 @@ import ( func RegisterSweepers() { awsv2.Register("aws_bedrockagent_agent", sweepAgents) awsv2.Register("aws_bedrockagent_data_source", sweepDataSources) - awsv2.Register("aws_bedrockagent_knowledge_base", sweepKnowledgeBases, "aws_bedrockagent_data_source") + awsv2.Register("aws_bedrockagent_knowledge_base", sweepKnowledgeBases, "aws_bedrockagent_agent", "aws_bedrockagent_data_source") } func sweepAgents(ctx context.Context, client *conns.AWSClient) ([]sweep.Sweepable, error) { @@ -36,7 +36,7 @@ func sweepAgents(ctx context.Context, client *conns.AWSClient) ([]sweep.Sweepabl for _, v := range page.AgentSummaries { sweepResources = append(sweepResources, framework.NewSweepResource(newAgentResource, client, - framework.NewAttribute("agent_id", aws.ToString(v.AgentId)), framework.NewAttribute("skip_resource_in_use_check", true))) + framework.NewAttribute(names.AttrID, aws.ToString(v.AgentId)), framework.NewAttribute("skip_resource_in_use_check", true))) } }