From 7eb75eefc206e2fd556b7cfef7b49dab48054e7a Mon Sep 17 00:00:00 2001 From: Tom McLaughlin Date: Sat, 17 Aug 2024 01:43:01 -0400 Subject: [PATCH] Split OAM sink from datadog --- stacksets/cloudwtach-oam-sink/stackset.yaml | 42 +++++++++++++++++++ .../template.yaml} | 0 stacksets/datadog-shipping/stackset.yaml | 28 ------------- template.yaml | 8 ++++ 4 files changed, 50 insertions(+), 28 deletions(-) create mode 100644 stacksets/cloudwtach-oam-sink/stackset.yaml rename stacksets/{datadog-shipping/oam-sink-template.yaml => cloudwtach-oam-sink/template.yaml} (100%) diff --git a/stacksets/cloudwtach-oam-sink/stackset.yaml b/stacksets/cloudwtach-oam-sink/stackset.yaml new file mode 100644 index 0000000..3a712b5 --- /dev/null +++ b/stacksets/cloudwtach-oam-sink/stackset.yaml @@ -0,0 +1,42 @@ +Metadata: + OamSink: + localTemplateFile: &oam_sink_template_body ./template.yaml + +AWSTemplateFormatVersion: '2010-09-09' +Transform: AWS::Serverless-2016-10-31 +Description: AWS account infrastructure stackset (CW oam sink) + +Parameters: + ObservabilityOu: + Type: CommaDelimitedList + Description: List of OUs + TargetRegions: + Type: CommaDelimitedList + Description: Regions to deploy to + AwsOrgId: + Type: String + +Resources: + CloudWatchOamSinkStacxkSet: + Type: AWS::CloudFormation::StackSet + Properties: + StackSetName: CloudWatchOamSink + Description: CloudWatch OAM Sink + Parameters: + - ParameterKey: AwsOrgId + ParameterValue: !Ref AwsOrgId + StackInstancesGroup: + - DeploymentTargets: + OrganizationalUnitIds: !Ref ObservabilityOu + Regions: !Ref TargetRegions + AutoDeployment: + Enabled: true + RetainStacksOnAccountRemoval: false + ManagedExecution: + Active: true + OperationPreferences: + RegionConcurrencyType: PARALLEL + FailureToleranceCount: 1 + MaxConcurrentCount: 5 + PermissionModel: SERVICE_MANAGED + TemplateBody: *oam_sink_template_body diff --git a/stacksets/datadog-shipping/oam-sink-template.yaml b/stacksets/cloudwtach-oam-sink/template.yaml similarity index 100% rename from stacksets/datadog-shipping/oam-sink-template.yaml rename to stacksets/cloudwtach-oam-sink/template.yaml diff --git a/stacksets/datadog-shipping/stackset.yaml b/stacksets/datadog-shipping/stackset.yaml index 8a947dd..85bbc69 100644 --- a/stacksets/datadog-shipping/stackset.yaml +++ b/stacksets/datadog-shipping/stackset.yaml @@ -1,8 +1,6 @@ Metadata: DatadogLogShipping: localTemplateFile: &dd_logs_template_body ./logs-template.yaml - OamSink: - localTemplateFile: &oam_sink_template_body ./oam-sink-template.yaml AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 @@ -15,8 +13,6 @@ Parameters: TargetRegions: Type: CommaDelimitedList Description: Regions to deploy to - AwsOrgId: - Type: String DatadogHttpEndpointUrl: Type: String DatadogApiKey: @@ -51,27 +47,3 @@ Resources: MaxConcurrentCount: 5 PermissionModel: SERVICE_MANAGED TemplateBody: *dd_logs_template_body - - CloudWatchOamSinkStacxkSet: - Type: AWS::CloudFormation::StackSet - Properties: - StackSetName: CloudWatchOamSink - Description: CloudWatch OAM Sink - Parameters: - - ParameterKey: AwsOrgId - ParameterValue: !Ref AwsOrgId - StackInstancesGroup: - - DeploymentTargets: - OrganizationalUnitIds: !Ref ObservabilityOu - Regions: !Ref TargetRegions - AutoDeployment: - Enabled: true - RetainStacksOnAccountRemoval: false - ManagedExecution: - Active: true - OperationPreferences: - RegionConcurrencyType: PARALLEL - FailureToleranceCount: 1 - MaxConcurrentCount: 5 - PermissionModel: SERVICE_MANAGED - TemplateBody: *oam_sink_template_body diff --git a/template.yaml b/template.yaml index ee61a29..66d4edc 100644 --- a/template.yaml +++ b/template.yaml @@ -28,4 +28,12 @@ Resources: TargetRegions: !Ref TargetRegions DatadogHttpEndpointUrl: !Ref DatadogHttpEndpointUrl DatadogApiKey: !Ref DatadogApiKey + + OamSinkStackSet: + Type: AWS::Serverless::Application + Properties: + Location: "./stacksets/cloudwatch-oam-sink/stackset.yaml" + Parameters: + ObservabilityOu: !Ref ObservabilityOu + TargetRegions: !Ref TargetRegions AwsOrgId: !Ref AwsOrgId