Skip to content

Add datasource for security groups - #328

Open
bddvlpr wants to merge 1 commit into
apache:mainfrom
bddvlpr:feat/security-group-datasource
Open

Add datasource for security groups#328
bddvlpr wants to merge 1 commit into
apache:mainfrom
bddvlpr:feat/security-group-datasource

Conversation

@bddvlpr

@bddvlpr bddvlpr commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Currently only handles the groups themselves, no rules yet. Even if this functionality gets added, It'd be better to keep them separate. Same filter function applied as other datasources do. Minimal amount of attributes but this is primarily to fetch IDs from separate states.

Copilot AI lite review requested due to automatic review settings August 28, 2026 06:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@sureshanaparti

Copy link
Copy Markdown
Contributor

Hi @bddvlpr Can you check the failed tests here. Thanks.

@bddvlpr

bddvlpr commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

Same as #327 (comment).

@sureshanaparti
sureshanaparti requested a lite review from Copilot September 2, 2026 07:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Comment on lines +31 to +32
resourceName := "cloudstack_security_group.security-group-resource"
dataSourceName := "data.cloudstack_security_group.security-group-data-source"
Comment on lines +53 to +64
resource "cloudstack_security_group" "security-group-resource" {
name = "%[1]s"
description = "Security group data source acceptance test"
}

data "cloudstack_security_group" "security-group-data-source" {
filter {
name = "name"
value = "^%[1]s$"
}
depends_on = [cloudstack_security_group.security-group-resource]
}
Comment on lines +123 to +128
for _, filter := range filters.List() {
values := filter.(map[string]interface{})
pattern, err := regexp.Compile(values["value"].(string))
if err != nil {
return false, fmt.Errorf("invalid regex: %s", err)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants