Skip to content

Commit

Permalink
Merge pull request #42 from clouddrove/fix/enable-false
Browse files Browse the repository at this point in the history
Fix: enable false
  • Loading branch information
d4kverma authored Oct 4, 2023
2 parents 0274b00 + 3321e29 commit 39a238b
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/auto_assignee.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
workflow_dispatch:
jobs:
assignee:
uses: clouddrove/github-shared-workflows/.github/workflows/auto_assignee.yml@master
uses: clouddrove/github-shared-workflows/.github/workflows/auto_assignee.yml@1.0.6
secrets:
GITHUB: ${{ secrets.GITHUB }}
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
workflow_dispatch:
jobs:
call-workflow-changelog:
uses: clouddrove/github-shared-workflows/.github/workflows/changelog.yml@master
uses: clouddrove/github-shared-workflows/.github/workflows/changelog.yml@1.0.6
secrets: inherit
with:
branch: 'master'
6 changes: 3 additions & 3 deletions .github/workflows/readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
python-version: '3.x'

- name: 'create readme'
uses: 'clouddrove/github-actions@v9.0.2'
uses: 'clouddrove/github-actions@9.0.3'
with:
actions_subcommand: 'readme'
github_token: '${{ secrets.GITHUB }}'
Expand All @@ -35,7 +35,7 @@ jobs:
continue-on-error: true

- name: 'push readme'
uses: 'clouddrove/github-actions@v9.0.2'
uses: 'clouddrove/github-actions@9.0.3'
continue-on-error: true
with:
actions_subcommand: 'push'
Expand All @@ -51,4 +51,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }} # required
if: always()
if: always()
10 changes: 5 additions & 5 deletions .github/workflows/tf-checks.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
name: tf-checks
on:
push:
branches: [ master ]
branches: [ 1.0.6 ]
pull_request:
workflow_dispatch:
jobs:
tf-checks-basic-example:
uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@master
uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@1.0.6
with:
working_directory: './_example/basic/'
tf-checks-complete-example:
uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@master
uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@1.0.6
with:
working_directory: './_example/complete/'
tf-checks-only_rules-example:
uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@master
uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@1.0.6
with:
working_directory: './_example/only_rules/'
tf-checks-prefx_list-example:
uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@master
uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@1.0.6
with:
working_directory: './_example/prefix_list/'
2 changes: 1 addition & 1 deletion .github/workflows/tflint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ on:
workflow_dispatch:
jobs:
tf-lint:
uses: clouddrove/test-tfsec/.github/workflows/tflint.yaml@master
uses: clouddrove/github-shared-workflows/.github/workflows/[email protected]
secrets:
GITHUB: ${{ secrets.GITHUB }}
2 changes: 1 addition & 1 deletion .github/workflows/tfsec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
workflow_dispatch:
jobs:
tfsec:
uses: clouddrove/github-shared-workflows/.github/workflows/tfsec.yml@master
uses: clouddrove/github-shared-workflows/.github/workflows/tfsec.yml@1.0.6
secrets: inherit
with:
working_directory: '.'
10 changes: 5 additions & 5 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ resource "aws_security_group_rule" "new_sg_ingress_with_prefix_list" {
protocol = each.value.protocol
to_port = each.value.to_port
security_group_id = aws_security_group.default[0].id
prefix_list_ids = lookup(each.value, "prefix_list_ids", null) == null ? aws_ec2_managed_prefix_list.prefix_list.*.id : lookup(each.value, "prefix_list_ids", null)
prefix_list_ids = lookup(each.value, "prefix_list_ids", null) == null ? aws_ec2_managed_prefix_list.prefix_list[*].id : lookup(each.value, "prefix_list_ids", null)
description = lookup(each.value, "description", null)
}

Expand Down Expand Up @@ -158,7 +158,7 @@ resource "aws_security_group_rule" "existing_sg_ingress_with_prefix_list" {
protocol = each.value.protocol
to_port = each.value.to_port
security_group_id = data.aws_security_group.existing[0].id
prefix_list_ids = lookup(each.value, "prefix_list_ids", null) == null ? aws_ec2_managed_prefix_list.prefix_list.*.id : lookup(each.value, "prefix_list_ids", null)
prefix_list_ids = lookup(each.value, "prefix_list_ids", null) == null ? aws_ec2_managed_prefix_list.prefix_list[*].id : lookup(each.value, "prefix_list_ids", null)
description = lookup(each.value, "description", null)
}

Expand Down Expand Up @@ -210,7 +210,7 @@ resource "aws_security_group_rule" "new_sg_egress_with_prefix_list" {
protocol = each.value.protocol
to_port = each.value.to_port
security_group_id = aws_security_group.default[0].id
prefix_list_ids = lookup(each.value, "prefix_list_ids", null) == null ? aws_ec2_managed_prefix_list.prefix_list.*.id : lookup(each.value, "prefix_list_ids", null)
prefix_list_ids = lookup(each.value, "prefix_list_ids", null) == null ? aws_ec2_managed_prefix_list.prefix_list[*].id : lookup(each.value, "prefix_list_ids", null)
description = lookup(each.value, "description", null)
}

Expand Down Expand Up @@ -262,6 +262,6 @@ resource "aws_security_group_rule" "existing_sg_egress_with_prefix_list" {
protocol = each.value.protocol
to_port = each.value.to_port
security_group_id = data.aws_security_group.existing[0].id
prefix_list_ids = lookup(each.value, "prefix_list_ids", null) == null ? aws_ec2_managed_prefix_list.prefix_list.*.id : lookup(each.value, "prefix_list_ids", null)
prefix_list_ids = lookup(each.value, "prefix_list_ids", null) == null ? aws_ec2_managed_prefix_list.prefix_list[*].id : lookup(each.value, "prefix_list_ids", null)
description = lookup(each.value, "source_address_prefix", null)
}
}
8 changes: 4 additions & 4 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
output "prefix_list_id" {
value = var.prefix_list_enabled && length(var.prefix_list_ids) < 1 ? aws_ec2_managed_prefix_list.prefix_list[0].id : null
value = var.enable && var.prefix_list_enabled && length(var.prefix_list_ids) < 1 ? aws_ec2_managed_prefix_list.prefix_list[0].id : null
description = "The ID of the prefix list."
}

output "security_group_id" {
value = var.new_sg ? aws_security_group.default[0].id : null
value = var.new_sg && var.enable ? aws_security_group.default[0].id : null
description = "IDs on the AWS Security Groups associated with the instance."
}

output "security_group_arn" {
value = var.new_sg ? aws_security_group.default[0].arn : null
value = var.new_sg && var.enable ? aws_security_group.default[0].arn : null
description = "IDs on the AWS Security Groups associated with the instance."
}

output "security_group_tags" {
value = var.new_sg ? aws_security_group.default[0].tags : null
value = var.new_sg && var.enable ? aws_security_group.default[0].tags : null
description = "A mapping of public tags to assign to the resource."
}

0 comments on commit 39a238b

Please sign in to comment.