Skip to content

Commit

Permalink
r/aws_bedrockagent_agent: Fix sweeper.
Browse files Browse the repository at this point in the history
  • Loading branch information
ewbankkit committed Jan 29, 2025
1 parent 596c131 commit 1ef8718
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/service/bedrockagent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
})

Expand Down
4 changes: 2 additions & 2 deletions internal/service/bedrockagent/sweep.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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)))
}
}

Expand Down

0 comments on commit 1ef8718

Please sign in to comment.