AWSTemplateFormatVersion: "2010-09-09" Description: AWS CloudFormation workshop - Language extensions (uksb-1q9p31idr) (tag:language-extensions). Metadata: cfn-lint: config: ignore_checks: - W3011 Parameters: DeletionPolicyParameter: Type: String AllowedValues: [Delete, Retain] Default: Delete LatestAmiId: Description: The ID of the region-specific Amazon Machine Image to use. Type: AWS::SSM::Parameter::Value Default: /aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2 Transform: AWS::LanguageExtensions Resources: Dashboard: Type: AWS::CloudWatch::Dashboard Properties: DashboardBody: Fn::ToJsonString: start: -PT6H periodOverride: inherit widgets: - type: metric x: 0 "y": 7 width: 3 height: 3 properties: metrics: [[AWS/EC2, CPUUtilization, InstanceId, !Ref EC2Instance]] period: 300 stat: Average region: !Ref AWS::Region title: EC2 Instance CPU EC2Instance: DeletionPolicy: !Ref DeletionPolicyParameter Type: AWS::EC2::Instance Properties: ImageId: !Ref LatestAmiId InstanceType: t2.micro Tags: - Key: Environment Value: DEV Outputs: InstanceId: Description: The ID of the newly-created EC2 instance. Value: !Ref EC2Instance