Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/service/networkfirewall: Add Service PreCheck, Adjust ImportState Locations, Adjust aws_subnet Sweeper Dependencies #16301

Closed
2 of 3 tasks
bflad opened this issue Nov 19, 2020 · 2 comments
Labels
partition/aws-us-gov Pertains to the aws-us-gov partition. service/networkfirewall Issues and PRs that pertain to the networkfirewall service. stale Old or inactive issues managed by automation, if no further action taken these will get closed. technical-debt Addresses areas of the codebase that need refactoring or redesign. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.

Comments

@bflad
Copy link
Contributor

bflad commented Nov 19, 2020

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Multi-part followup issue to capture testing-only items from #16277 (review)

  • Add service PreCheck to all Network Firewall acceptance tests: testAccPartitionHasServicePreCheck(networkfirewall.EndpointsID, t) (r/networkfirewall: add service precheck #16492)
  • ImportState test steps should be immediately after a configuration step where the API object has a non-default value
  • aws_subnet test sweeper should include new dependency on aws_networkfirewall_firewall sweeper since Network Firewall Firewalls create ENIs in EC2 Subnets

Affected Resource(s)

  • aws_networkfirewall_firewall
  • aws_networkfirewall_firewall_policy
  • aws_networkfirewall_logging_configuration
  • aws_networkfirewall_rule_group

Potential Terraform Code

e.g. for PreCheck and ImportState

func TestAccAwsNetworkFirewallFirewall_description(t *testing.T) {
	rName := acctest.RandomWithPrefix("tf-acc-test")
	resourceName := "aws_networkfirewall_firewall.test"

	resource.ParallelTest(t, resource.TestCase{
		PreCheck:     func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(networkfirewall.EndpointsID, t) },
		Providers:    testAccProviders,
		CheckDestroy: testAccCheckAwsNetworkFirewallFirewallDestroy,
		Steps: []resource.TestStep{
			{
				Config: testAccNetworkFirewallFirewall_basic(rName),
				Check: resource.ComposeTestCheckFunc(
					testAccCheckAwsNetworkFirewallFirewallExists(resourceName),
					resource.TestCheckResourceAttr(resourceName, "description", ""),
				),
			},
			{
				Config: testAccNetworkFirewallFirewall_updateDescription(rName, "updated"),
				Check: resource.ComposeTestCheckFunc(
					testAccCheckAwsNetworkFirewallFirewallExists(resourceName),
					resource.TestCheckResourceAttr(resourceName, "description", "updated"),
				),
			},
			{
				ResourceName:      resourceName,
				ImportState:       true,
				ImportStateVerify: true,
			},
			{
				Config: testAccNetworkFirewallFirewall_basic(rName),
				Check: resource.ComposeTestCheckFunc(
					testAccCheckAwsNetworkFirewallFirewallExists(resourceName),
					resource.TestCheckResourceAttr(resourceName, "description", ""),
				),
			},
		},
	})
}

References

@bflad bflad added tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. technical-debt Addresses areas of the codebase that need refactoring or redesign. partition/aws-us-gov Pertains to the aws-us-gov partition. labels Nov 19, 2020
@ghost ghost added the service/networkfirewall Issues and PRs that pertain to the networkfirewall service. label Nov 19, 2020
Copy link

github-actions bot commented Jan 1, 2024

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!

@github-actions github-actions bot added the stale Old or inactive issues managed by automation, if no further action taken these will get closed. label Jan 1, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 18, 2024
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
partition/aws-us-gov Pertains to the aws-us-gov partition. service/networkfirewall Issues and PRs that pertain to the networkfirewall service. stale Old or inactive issues managed by automation, if no further action taken these will get closed. technical-debt Addresses areas of the codebase that need refactoring or redesign. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

No branches or pull requests

1 participant