cfndsl 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YmEzYWFkNWUxNGEwYzE5MDFkYTczOWUzNTk4NDIyZmE0ODM3NTI0Nw==
4
+ YjQzYjY0M2VhNGE2NGNhYjYxNTk4YjFhOWE0MGQ2YWNmNDQ4ZTcyYg==
5
5
  data.tar.gz: !binary |-
6
- YTZlMzMxMmQ0NGQ2NjM4NjdjNDRmMmM1NzA3NDZiNTYzOTM0MzZjOA==
6
+ ODE0NWZkNmM5YjZjMTMzNzdmNjQ5ODE0ODMzZjZhNjIxYTFkYmU2Mw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZGIzZWZiZjFiMDdlMTAwNzdjYzk5NGQ0N2VjZTQ2NDQxNTQ0OGM4NTMyMGIy
10
- MDA0ZDA4MTI5MTRjZGE2OGNhMmFlZjAxNmY5ZWY4OGZkZTI4MzRkNWIzMWJh
11
- NjgzZGYyODczNzdiMWEzY2RhMWFhMTVkMThmZWJmZjhlMDQwNGE=
9
+ ODgyMGY0MzBhODIyYjFmOWVmMjZkNjhjODZiNjFkMjM4YzVmNTlkOTc1ODEw
10
+ NGRlM2I0YmMwY2I4MDVhM2I1MTY3NTQyMGJiZDk1ZDAwMTQ0NWYyMWYxMGU5
11
+ MTYyYjhiZjI3YTRhNDc1Zjk0MTZhNTNlZDBlMmIyMWU2MWQwMjM=
12
12
  data.tar.gz: !binary |-
13
- MjRiNDFjZDFhNDA0ZmU0NDAwYjY1ZTAxNjQxNzhlMDAzYjc5MzA0ZDg3NWJh
14
- YzUyNmQ3MmZjYWIzZmQ5M2EzOWNiNjA3MTU3NTM2NDNiYTQwYzZlYTU0MDQy
15
- NWYxNzcxNWM2M2YwZDMyNDY0NDZhNjZhMjA2MThhZjA4MDlkYTc=
13
+ ZDE0MWVjZjkyZTk0N2JkMjlmZThjN2M1MWFkYzIxYzg5MTg5ODEzZTFlMmMw
14
+ NjkwNmZlNzhjOWUyMGQzMDljYjM1NmUwOTViNDRlMDUyY2M1OGVhOWYwNzY1
15
+ ZTUzMDBhMWM2Mzg4M2Y1YTZlYzBmYjc3MGIzZGY4NWY2M2QyMGU=
@@ -118,6 +118,26 @@ Resources:
118
118
  Statistic: String
119
119
  Threshold: String
120
120
  Unit: String
121
+ "AWS::Config::ConfigRule" :
122
+ Properties:
123
+ ConfigRuleName: String
124
+ Description: String
125
+ InputParameters: JSON
126
+ MaximumExecutionFrequency: String
127
+ Scope: ConfigRuleScope
128
+ Source: ConfigRuleSource
129
+ "AWS::Config::ConfigurationRecorder" :
130
+ Properties:
131
+ Name: String
132
+ RecordingGroup: ConfigurationRecorderRecordingGroup
133
+ RoleARN: String
134
+ "AWS::Config::DeliveryChannel" :
135
+ Properties:
136
+ ConfigSnapshotDeliveryProperties: DeliveryChannelConfigSnapshotDeliveryProperties
137
+ Name: String
138
+ S3BucketName: String
139
+ S3KeyPrefix: String
140
+ SnsTopicARN: String
121
141
  "AWS::DynamoDB::Table" :
122
142
  Properties :
123
143
  AttributeDefinitions : [ AttributeDefinitionsType ]
@@ -441,6 +461,14 @@ Resources:
441
461
  Roles: [ String ]
442
462
  Attributes:
443
463
  Arn : String
464
+ "AWS::IAM::ManagedPolicy" :
465
+ Properties:
466
+ Description: String
467
+ PolicyDocument: JSON
468
+ Path: String
469
+ Groups: [ String ]
470
+ Users: [ String ]
471
+ Roles: [ String ]
444
472
  "AWS::IAM::Policy" :
445
473
  Properties:
446
474
  PolicyName: String
@@ -468,6 +496,12 @@ Resources:
468
496
  Policies: [ IAMEmbeddedPolicy ]
469
497
  Attributes:
470
498
  Arn: String
499
+ "AWS::KMS::Key" :
500
+ Properties:
501
+ Description: String
502
+ Enabled: Boolean
503
+ EnableKeyRotation: Boolean
504
+ KeyPolicy: JSON
471
505
  "AWS::Logs::LogGroup" :
472
506
  Properties:
473
507
  RetentionInDays: Integer
@@ -538,53 +572,91 @@ Resources:
538
572
  ServiceRoleArn: String
539
573
  UseCustomCookbooks: Boolean
540
574
  VpcId: String
575
+ "AWS::RDS::DBCluster" :
576
+ Properties:
577
+ AvailabilityZones: [ String ]
578
+ BackupRetentionPeriod: Integer
579
+ DatabaseName: String
580
+ DBClusterParameterGroupName: String
581
+ DBSubnetGroupName: String
582
+ Engine: String
583
+ EngineVersion: String
584
+ MasterUsername: String
585
+ MasterUserPassword: String
586
+ Port: Integer
587
+ PreferredBackupWindow: String
588
+ PreferredMaintenanceWindow: String
589
+ SnapshotIdentifier: String
590
+ Tags: JSON
591
+ VpcSecurityGroupIds: [ String ]
592
+ "AWS::RDS::DBClusterParameterGroup" :
593
+ Properties:
594
+ Description: String
595
+ Family: String
596
+ Parameters: JSON
597
+ Tags: JSON
541
598
  "AWS::RDS::DBInstance" :
542
599
  Properties:
543
- DBSnapshotIdentifier: String
544
- AllocatedStorage: String
545
- AvailabilityZone: String
546
- BackupRetentionPeriod: String
547
- DBInstanceClass: String
548
- DBInstanceIdentifier: String
549
- DBName: String
550
- DBParameterGroupName: String
551
- DBSecurityGroups: [ String ]
552
- DBSubnetGroupName: String
553
- Engine: String
554
- EngineVersion: String
555
- LicenseModel: String
556
- MasterUsername: String
557
- MasterUserPassword: String
558
- Port: String
559
- PreferredBackupWindow: String
560
- PreferredMaintenanceWindow: String
561
- PubliclyAccessible: String
562
- MultiAZ: Boolean
563
- SourceDBInstanceIdentifier: String
564
- Tags: [ EC2Tag ]
565
- VPCSecurityGroups: [ String ]
600
+ AllocatedStorage: String
601
+ AllowMajorVersionUpgrade: Boolean
602
+ AutoMinorVersionUpgrade: Boolean
603
+ AvailabilityZone: String
604
+ BackupRetentionPeriod: String
605
+ CharacterSetName: String
606
+ DBClusterIdentifier: String
607
+ DBInstanceClass: String
608
+ DBInstanceIdentifier: String
609
+ DBName: String
610
+ DBParameterGroupName: String
611
+ DBSecurityGroups: [ String ]
612
+ DBSnapshotIdentifier: String
613
+ DBSubnetGroupName: String
614
+ Engine: String
615
+ EngineVersion: String
616
+ Iops: Number
617
+ KmsKeyId: String
618
+ LicenseModel: String
619
+ MasterUsername: String
620
+ MasterUserPassword: String
621
+ MultiAZ: Boolean
622
+ OptionGroupName: String
623
+ Port: String
624
+ PreferredBackupWindow: String
625
+ PreferredMaintenanceWindow: String
626
+ PubliclyAccessible: String
627
+ SourceDBInstanceIdentifier: String
628
+ StorageEncrypted: Boolean
629
+ StorageType: String
630
+ Tags: [ EC2Tag ]
631
+ VPCSecurityGroups: [ String ]
566
632
  Attributes:
567
- DBInstanceIdentifier: String
568
- Endpoint.Address: String
569
- Endpoint.Port: String
633
+ DBInstanceIdentifier: String
634
+ Endpoint.Address: String
635
+ Endpoint.Port: String
636
+ "AWS::RDS::DBParameterGroup":
637
+ Properties:
638
+ Description: String
639
+ Family: String
640
+ Parameters: JSON
641
+ Tags: JSON
570
642
  "AWS::RDS::DBSecurityGroup" :
571
- Properties:
572
- EC2VpcId: String
573
- DBSecurityGroupIngress: [ RDSSecurityGroupRule ]
574
- GroupDescription: String
575
- SubnetIds: [ String ]
643
+ Properties:
644
+ EC2VpcId: String
645
+ DBSecurityGroupIngress: [ RDSSecurityGroupRule ]
646
+ GroupDescription: String
647
+ SubnetIds: [ String ]
576
648
  "AWS::RDS::DBSubnetGroup" :
577
- Properties:
578
- DBSubnetGroupDescription: String
579
- SubnetIds: [ String ]
580
- Tags: [ EC2Tag ]
649
+ Properties:
650
+ DBSubnetGroupDescription: String
651
+ SubnetIds: [ String ]
652
+ Tags: [ EC2Tag ]
581
653
  "AWS::RDS::DBSecurityGroupIngress" :
582
- Properties:
583
- CIDRIR: String
584
- DBSecurityGroupName: String
585
- EC2SecurityGroupId: String
586
- EC2SecurityGroupName: String
587
- EC2SecurityGroupOwnerId: String
654
+ Properties:
655
+ CIDRIP: String
656
+ DBSecurityGroupName: String
657
+ EC2SecurityGroupId: String
658
+ EC2SecurityGroupName: String
659
+ EC2SecurityGroupOwnerId: String
588
660
  "AWS::Redshift::Cluster":
589
661
  Properties:
590
662
  Allowversionupgrade: Boolean
@@ -1020,4 +1092,20 @@ Types:
1020
1092
  S3NotificationTopicConfiguration:
1021
1093
  Event: String
1022
1094
  Topic: String
1023
-
1095
+ ConfigurationRecorderRecordingGroup:
1096
+ AllSupported: Boolean
1097
+ ResourceTypes: [ String ]
1098
+ DeliveryChannelConfigSnapshotDeliveryProperties:
1099
+ DeliveryFrequency: String
1100
+ ConfigRuleScope:
1101
+ ComplianceResourceId: String
1102
+ ComplianceResourceTypes: [ String ]
1103
+ TagKey: String
1104
+ TagValue: String
1105
+ ConfigRuleSource:
1106
+ Owner: String
1107
+ SourceDetails: ConfigRuleSourceDetails
1108
+ SourceIdentifier: String
1109
+ ConfigRuleSourceDetails:
1110
+ EventSource: String
1111
+ MessageType: String
@@ -1,3 +1,3 @@
1
1
  module CfnDsl
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
@@ -0,0 +1,119 @@
1
+ CloudFormation {
2
+ AWSTemplateFormatVersion "2010-09-09"
3
+
4
+ Description "Creates SNS, SQS, S3 bucket and enables AWS Config."
5
+
6
+ Queue("ConfigServiceQueue") {
7
+ QueueName "ConfigServiceQueue"
8
+ }
9
+
10
+ Bucket("ConfigServiceBucket") {
11
+ }
12
+
13
+ Policy("ConfigServiceS3BucketAccessPolicy") {
14
+ PolicyName "ConfigServiceS3BucketAccessPolicy"
15
+ PolicyDocument({
16
+ "Version" => "2012-10-17",
17
+ "Statement" =>
18
+ [
19
+ {
20
+ "Effect" => "Allow",
21
+ "Action" => ["s3:PutObject"],
22
+ "Resource" => FnJoin("", ["arn:aws:s3:::", Ref("ConfigServiceBucket"), "/AWSLogs/" , Ref("AWS::AccountId") , "/*"]),
23
+ "Condition" =>
24
+ {
25
+ "StringLike" =>
26
+ {
27
+ "s3:x-amz-acl" => "bucket-owner-full-control"
28
+ }
29
+ }
30
+ },
31
+ {
32
+ "Effect" => "Allow",
33
+ "Action" => ["s3:GetBucketAcl"],
34
+ "Resource" => FnJoin("", ["arn:aws:s3:::", Ref("ConfigServiceBucket")])
35
+ }
36
+ ]
37
+ })
38
+ Role Ref("ConfigServiceIAMRole")
39
+ }
40
+
41
+ Role("ConfigServiceIAMRole") {
42
+ AssumeRolePolicyDocument({
43
+ "Version" => "2012-10-17",
44
+ "Statement" => [
45
+ {
46
+ "Effect" => "Allow",
47
+ "Principal" => {
48
+ "Service" => "config.amazonaws.com"
49
+ },
50
+ "Action" => "sts:AssumeRole"
51
+ }
52
+ ]
53
+ })
54
+ ManagedPolicyArns([
55
+ "arn:aws:iam::aws:policy/service-role/AWSConfigRole"
56
+ ])
57
+ }
58
+
59
+ Topic("ConfigServiceTopic") {
60
+ DisplayName "ConfigSvc"
61
+ Subscription [{
62
+ "Endpoint" => FnGetAtt("ConfigServiceQueue", "Arn"),
63
+ "Protocol" => "sqs"
64
+ }]
65
+ }
66
+
67
+ Policy("ConfigServiceSNSTopicAccessPolicy") {
68
+ PolicyName "ConfigServiceSNSTopicAccessPolicy"
69
+ PolicyDocument({
70
+ "Version" => "2012-10-17",
71
+ "Statement" =>
72
+ [
73
+ {
74
+ "Effect" => "Allow",
75
+ "Action" => "sns:Publish",
76
+ "Resource" => Ref("ConfigServiceTopic")
77
+ }
78
+ ]
79
+ })
80
+ Role Ref("ConfigServiceIAMRole")
81
+ }
82
+
83
+ QueuePolicy("ConfigServiceQueuePolicy") {
84
+ PolicyDocument({
85
+ "Version" => "2012-10-17",
86
+ "Statement" => [
87
+ {
88
+ "Sid" => "Allow-SendMessage-To-ConfigService-Queue-From-SNS-Topic",
89
+ "Effect" => "Allow",
90
+ "Principal" => "*",
91
+ "Action" => ["sqs:SendMessage"],
92
+ "Resource" => "*",
93
+ "Condition" => {
94
+ "ArnEquals" => {
95
+ "aws:SourceArn" => Ref("ConfigServiceTopic")
96
+ }
97
+ }
98
+ }
99
+ ]
100
+ })
101
+ Queues [ Ref("ConfigServiceQueue") ]
102
+ }
103
+
104
+ DeliveryChannel("ConfigDeliveryChannel") {
105
+ ConfigSnapshotDeliveryProperties({
106
+ "DeliveryFrequency" => "Six_Hours"
107
+ })
108
+ S3BucketName Ref("ConfigServiceBucket")
109
+ SnsTopicARN Ref("ConfigServiceTopic")
110
+ }
111
+
112
+ ConfigurationRecorder("ConfigRecorder") {
113
+ Name "DefaultRecorder"
114
+ RecordingGroup({
115
+ "AllSupported" => true
116
+ })
117
+ RoleARN FnGetAtt("ConfigServiceIAMRole", "Arn")
118
+ }
119
+ }
@@ -0,0 +1,82 @@
1
+ CloudFormation {
2
+ AWSTemplateFormatVersion "2010-09-09"
3
+
4
+ Description "Creates sample IAM policies"
5
+
6
+ ManagedPolicy("AllowUserManagePasswordAccessKeys") {
7
+ Description "Allows user to manage passwords and access keys"
8
+ PolicyDocument({
9
+ "Version" => "2012-10-17",
10
+ "Statement" => [
11
+ {
12
+ "Effect" => "Allow",
13
+ "Action" => [
14
+ "iam:*LoginProfile",
15
+ "iam:*AccessKey*",
16
+ "iam:*SSHPublicKey*"
17
+ ],
18
+ "Resource" => FnJoin("", ["arn:aws:iam::", Ref("AWS::AccountId"), ":user/${aws:username}"])
19
+ }
20
+ ]
21
+ })
22
+ }
23
+
24
+ ManagedPolicy("AllowUserManageVirtualMFA") {
25
+ Description "Allows user to manage their virtual MFA device"
26
+ PolicyDocument({
27
+ "Version" => "2012-10-17",
28
+ "Statement" => [
29
+ {
30
+ "Sid" => "AllowUsersToCreateEnableResyncTheirOwnVirtualMFADevice",
31
+ "Effect" => "Allow",
32
+ "Action" => [
33
+ "iam:CreateVirtualMFADevice",
34
+ "iam:EnableMFADevice",
35
+ "iam:ResyncMFADevice"
36
+ ],
37
+ "Resource" => [
38
+ FnJoin("", ["arn:aws:iam::", Ref("AWS::AccountId"), ":mfa/${aws:username}"]),
39
+ FnJoin("", ["arn:aws:iam::", Ref("AWS::AccountId"), ":user/${aws:username}"])
40
+ ]
41
+ },
42
+ {
43
+ "Sid" => "AllowUsersToDeactivateDeleteTheirOwnVirtualMFADevice",
44
+ "Effect" => "Allow",
45
+ "Action" => [
46
+ "iam:DeactivateMFADevice",
47
+ "iam:DeleteVirtualMFADevice"
48
+ ],
49
+ "Resource" => [
50
+ FnJoin("", ["arn:aws:iam::", Ref("AWS::AccountId"), ":mfa/${aws:username}"]),
51
+ FnJoin("", ["arn:aws:iam::", Ref("AWS::AccountId"), ":user/${aws:username}"])
52
+ ],
53
+ "Condition" => {
54
+ "Bool" => {
55
+ "aws:MultiFactorAuthPresent" => true
56
+ }
57
+ }
58
+ },
59
+ {
60
+ "Sid" => "AllowUsersToListMFADevicesandUsersForConsole",
61
+ "Effect" => "Allow",
62
+ "Action" => [
63
+ "iam:ListMFADevices",
64
+ "iam:ListVirtualMFADevices",
65
+ "iam:ListUsers"
66
+ ],
67
+ "Resource" => "*"
68
+ }
69
+ ]
70
+ })
71
+ }
72
+
73
+ Output("AllowUserManagePasswordAccessKeysPolicyArn") {
74
+ Description "The ARN of the AllowUserManagePasswordAccessKeys IAM policy"
75
+ Value Ref("AllowUserManagePasswordAccessKeys")
76
+ }
77
+
78
+ Output("AllowUserManageVirtualMFAPolicyArn") {
79
+ Description "The ARN of the AllowUserManageVirtualMFA IAM policy"
80
+ Value Ref("AllowUserManageVirtualMFA")
81
+ }
82
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cfndsl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Jack
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-11-20 00:00:00.000000000 Z
12
+ date: 2015-12-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -69,7 +69,9 @@ files:
69
69
  - sample/autoscale2.rb
70
70
  - sample/circular.rb
71
71
  - sample/codedeploy.rb
72
+ - sample/config-service.rb
72
73
  - sample/ecs.rb
74
+ - sample/iam-policies.rb
73
75
  - sample/s3.rb
74
76
  - sample/t1.rb
75
77
  - sample/t1.yaml