Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 2.5k
test(capacity-provider): add integration test for ManagedResourceTags#3983
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
5bb83467797cde5e063c7cc4c6d3File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -138,6 +138,22 @@ def test_function_with_capacity_provider_default_role(self): | ||
| self.verify_capacity_provider_vpc_config(simple_cp_config, "SimpleCapacityProvider") | ||
| self.verify_capacity_provider_permissions_config(simple_cp_config, "SimpleCapacityProvider") | ||
| # Verify Globals.CapacityProvider.ManagedResourceTags inheritance on SimpleCapacityProvider | ||
| simple_propagate_tags = simple_cp_config.get("PropagateTags") | ||
| self.assertIsNotNone(simple_propagate_tags, "SimpleCapacityProvider should inherit PropagateTags from Globals") | ||
| self.assertEqual( | ||
| simple_propagate_tags.get("Mode"), | ||
| "Explicit", | ||
| "SimpleCapacityProvider should have PropagateTags Mode: Explicit from Globals", | ||
| ) | ||
| simple_explicit_tags = simple_propagate_tags.get("ExplicitTags", {}) | ||
| self.assertIn("GlobalTag", simple_explicit_tags, "SimpleCapacityProvider should inherit GlobalTag from Globals") | ||
| self.assertEqual( | ||
| simple_explicit_tags["GlobalTag"], | ||
| "shared-value", | ||
| "GlobalTag should be 'shared-value' from Globals", | ||
| ) | ||
| advanced_cp_config = self.get_lambda_capacity_provider_config("AdvancedCapacityProvider") | ||
| self.verify_capacity_provider_basic_config(advanced_cp_config, "AdvancedCapacityProvider") | ||
| self.verify_capacity_provider_vpc_config(advanced_cp_config, "AdvancedCapacityProvider") | ||
| @@ -180,6 +196,23 @@ def test_function_with_capacity_provider_default_role(self): | ||
| "AdvancedCapacityProvider should use the correct KMS key", | ||
| ) | ||
| # Verify ManagedResourceTags -> PropagateTags configuration | ||
| propagate_tags = advanced_cp_config.get("PropagateTags") | ||
| self.assertIsNotNone(propagate_tags, "AdvancedCapacityProvider should have PropagateTags configuration") | ||
| self.assertEqual( | ||
| propagate_tags.get("Mode"), "Explicit", "AdvancedCapacityProvider should have PropagateTags Mode: Explicit" | ||
| ) | ||
| explicit_tags = propagate_tags.get("ExplicitTags", {}) | ||
vicheey marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. vicheey marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| self.assertIn("Environment", explicit_tags, "AdvancedCapacityProvider should propagate Environment tag") | ||
| self.assertIn("Team", explicit_tags, "AdvancedCapacityProvider should propagate Team tag") | ||
| self.assertIn("GlobalTag", explicit_tags, "AdvancedCapacityProvider should override GlobalTag from Globals") | ||
| self.assertEqual(explicit_tags["Environment"], "Production", "Environment tag should be 'Production'") | ||
| self.assertEqual(explicit_tags["Team"], "Lambda-Tooling", "Team tag should be 'Lambda-Tooling'") | ||
| self.assertEqual( | ||
| explicit_tags["GlobalTag"], "overridden-value", "GlobalTag should be overridden by resource-level value" | ||
| ) | ||
| telemetry_config = advanced_cp_config.get("TelemetryConfig") | ||
| self.assertIsNotNone(telemetry_config, "AdvancedCapacityProvider should have TelemetryConfig") | ||
| logging_config = telemetry_config.get("LoggingConfig") | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -6,6 +6,12 @@ Parameters: | ||
| KMSKeyArn: | ||
| Type: String | ||
| Globals: | ||
| CapacityProvider: | ||
| ManagedResourceTags: | ||
| Tags: | ||
| GlobalTag: shared-value | ||
| Resources: | ||
| SimpleCapacityProvider: | ||
| Type: AWS::Serverless::CapacityProvider | ||
| @@ -45,6 +51,11 @@ Resources: | ||
| KmsKeyArn: !Ref KMSKeyArn | ||
| LoggingConfig: | ||
| SystemLogLevel: DEBUG | ||
| ManagedResourceTags: | ||
vicheey marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| Tags: | ||
| Environment: Production | ||
| Team: Lambda-Tooling | ||
| GlobalTag: overridden-value | ||
| Tags: | ||
| Environment: Test | ||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.