From 4d27022c8a0c6a6efd4a8880155359b166a34a4a Mon Sep 17 00:00:00 2001 From: Nitin More Date: Wed, 13 Dec 2023 16:58:31 +0530 Subject: [PATCH] added sample files for ssm parameters --- cft/ssm/output.json | 91 +++++++++++++++++++++++++++++++++++ cft/ssm/parameters/deploy.yml | 49 +++++++++++++++++++ 2 files changed, 140 insertions(+) create mode 100644 cft/ssm/output.json create mode 100644 cft/ssm/parameters/deploy.yml diff --git a/cft/ssm/output.json b/cft/ssm/output.json new file mode 100644 index 00000000..6db1c695 --- /dev/null +++ b/cft/ssm/output.json @@ -0,0 +1,91 @@ +{ + "aws_instance": [ + { + "id": "aws_instance.myinstance", + "name": "myinstance", + "source": "common.yml", + "line": 1, + "type": "aws_instance", + "config": { + "tags": null, + "name": "myinstance", + "ami": "", + "instance_type": "", + "ebs_optimized": false, + "hibernation": false, + "monitoring": false, + "iam_instance_profile": "", + "vpc_security_group_ids": null, + "network_interface": [] + }, + "skip_rules": [], + "max_severity": "", + "min_severity": "" + } + ], + "aws_ssm_parameter": [ + { + "id": "aws_ssm_parameter.AdvancedParameter", + "name": "AdvancedParameter", + "source": "common.yml", + "line": 1, + "type": "aws_ssm_parameter", + "config": { + "tags": null, + "name": "AnotherName", + "description": "", + "type": "String", + "value": "anothervalue", + "tier": "", + "policies": "", + "allowed_pattern": "" + }, + "skip_rules": [], + "max_severity": "", + "min_severity": "" + }, + { + "id": "aws_ssm_parameter.BasicParameter", + "name": "BasicParameter", + "source": "common.yml", + "line": 1, + "type": "aws_ssm_parameter", + "config": { + "tags": null, + "name": "AvailabilityZone", + "description": "", + "type": "String", + "value": "somevalue", + "tier": "", + "policies": "", + "allowed_pattern": "" + }, + "skip_rules": [], + "max_severity": "", + "min_severity": "" + }, + { + "id": "aws_ssm_parameter.BasicParameterWithPolicieis", + "name": "BasicParameterWithPolicieis", + "source": "common.yml", + "line": 1, + "type": "aws_ssm_parameter", + "config": { + "tags": { + "Environment": "DEV" + }, + "name": "command", + "description": "SSM Parameter for running date command.", + "type": "String", + "value": "date", + "tier": "Advanced", + "policies": "[{\"Type\":\"Expiration\",\"Version\":\"1.0\",\"Attributes\":{\"Timestamp\":\"2020-05-13T00:00:00.000Z\"}},{\"Type\":\"ExpirationNotification\",\"Version\":\"1.0\",\"Attributes\":{\"Before\":\"5\",\"Unit\":\"Days\"}},{\"Type\":\"NoChangeNotification\",\"Version\":\"1.0\",\"Attributes\":{\"After\":\"60\",\"Unit\":\"Days\"}}]", + "allowed_pattern": "^[a-zA-Z]{1,10}$" + }, + "skip_rules": [], + "max_severity": "", + "min_severity": "" + } + ] +} + diff --git a/cft/ssm/parameters/deploy.yml b/cft/ssm/parameters/deploy.yml new file mode 100644 index 00000000..0b1dd0f7 --- /dev/null +++ b/cft/ssm/parameters/deploy.yml @@ -0,0 +1,49 @@ +--- +AWSTemplateFormatVersion: '2010-09-09' +Parameters: + AvailabilityZone: + Description: Amazon EC2 instance Availability Zone + Type: String + AMIId: + Description: The Amazon Machine Image id + Type: String + InstanceType: + Description: The Type of instance + Type: String +Resources: + myinstance: + Type: AWS::EC2::Instance + Properties: + AvailabilityZone: + Fn::GetAtt: + - BasicParameter + - Value + ImageId: + Ref: AMIId + InstanceType: + Ref: InstanceType + BasicParameter: + Type: AWS::SSM::Parameter + Properties: + Name: AvailabilityZone + Type: String + Value: somevalue + AdvancedParameter: + Type: AWS::SSM::Parameter + Properties: + Name: AnotherName + Type: String + Value: anothervalue + + BasicParameterWithPolicieis: + Type: AWS::SSM::Parameter + Properties: + Name: command + Type: String + Value: date + Tier: Advanced + Policies: '[{"Type":"Expiration","Version":"1.0","Attributes":{"Timestamp":"2020-05-13T00:00:00.000Z"}},{"Type":"ExpirationNotification","Version":"1.0","Attributes":{"Before":"5","Unit":"Days"}},{"Type":"NoChangeNotification","Version":"1.0","Attributes":{"After":"60","Unit":"Days"}}]' + Description: SSM Parameter for running date command. + AllowedPattern: "^[a-zA-Z]{1,10}$" + Tags: + Environment: DEV \ No newline at end of file