description: Document to orchestrate the the SQL database License Tracking Solution schemaVersion: '0.3' assumeRole: "{{ AutomationAssumeRole }}" parameters: DeploymentTargets: type: StringList description: Specify the AWS Accounts/OUs where SQL databases are deployed TargetRegions: type: StringList description: Specify the AWS Regions where SQL databases are deployed TargetKey: type: String default: tag:SQLServerLTS-ManagedInstance description: "(Optional) Specify the instances you want to target using Resource Groups, tags (use tag: format) or all instances with InstanceIds. Refer https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_StartAutomationExecution.html for more details." TargetValues: type: String default: 'true' description: "(Optional) Specify the values you want to target like tag value or * for all instances. Refer https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_StartAutomationExecution.html for more details." AutomationAssumeRole: type: String description: The IAM role required to execute this document (select SQLServerLTS-SystemsManagerAutomationAdministrationRole from the drop-down if you deployed this solution using CloudFormation) MaxConcurrency: type: String default: '4' MaxErrors: type: String default: '4' mainSteps: - name: invokeSQLServerLTS_DeleteInventory description: This step invokes the invokeSQLServerLTS_DeleteInventory Automation action: aws:executeAutomation inputs: RuntimeParameters: AutomationAssumeRole: - "{{ AutomationAssumeRole }}" DocumentName: arn:${AWS::Partition}:ssm:{{global:REGION}}:${AWS::AccountId}:document/SQLServerLTS-DeleteInventory TargetLocations: - Accounts: "{{ DeploymentTargets }}" ExecutionRoleName: SQLServerLTS-SystemsManagerAutomationExecutionRole Regions: "{{ TargetRegions }}" TargetLocationMaxConcurrency: "{{ MaxConcurrency }}" TargetLocationMaxErrors: "{{ MaxErrors }}" isCritical: true onFailure: Abort nextStep: invokeSQLServerLTS_ManageLicenceUtilizationAutomation - name: invokeSQLServerLTS_ManageLicenceUtilizationAutomation description: This step invokes the invokeSQLServerLTS_ManageLicenceUtilization Automation action: aws:executeAutomation inputs: RuntimeParameters: AutomationAssumeRole: - "{{ AutomationAssumeRole }}" DocumentName: arn:${AWS::Partition}:ssm:{{global:REGION}}:${AWS::AccountId}:document/SQLServerLTS-ManageLicenceUtilization TargetLocations: - Accounts: "{{ DeploymentTargets }}" ExecutionRoleName: SQLServerLTS-SystemsManagerAutomationExecutionRole Regions: "{{ TargetRegions }}" TargetLocationMaxConcurrency: "{{ MaxConcurrency }}" TargetLocationMaxErrors: "{{ MaxErrors }}" TargetParameterName: InstanceId Targets: - Key: "{{ TargetKey }}" Values: - "{{ TargetValues }}" isCritical: true onFailure: Abort isEnd: true