skywriter 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +18 -0
- data/.rspec +2 -0
- data/.travis.yml +8 -0
- data/CHANGES.md +5 -0
- data/Gemfile +4 -0
- data/LICENSE.md +22 -0
- data/README.md +139 -0
- data/Rakefile +7 -0
- data/lib/skywriter/function.rb +133 -0
- data/lib/skywriter/resource/auto_scaling/auto_scaling_group.rb +28 -0
- data/lib/skywriter/resource/auto_scaling/launch_configuration.rb +28 -0
- data/lib/skywriter/resource/auto_scaling/scaling_policy.rb +18 -0
- data/lib/skywriter/resource/auto_scaling/scheduled_action.rb +21 -0
- data/lib/skywriter/resource/auto_scaling/trigger.rb +26 -0
- data/lib/skywriter/resource/cloud_formation/authentication.rb +46 -0
- data/lib/skywriter/resource/cloud_formation/custom_resource.rb +17 -0
- data/lib/skywriter/resource/cloud_formation/stack.rb +15 -0
- data/lib/skywriter/resource/cloud_formation/wait_condition.rb +15 -0
- data/lib/skywriter/resource/cloud_formation/wait_condition_handle.rb +12 -0
- data/lib/skywriter/resource/cloud_front/distribution.rb +13 -0
- data/lib/skywriter/resource/cloud_watch/alarm.rb +27 -0
- data/lib/skywriter/resource/dynamo_db/table.rb +18 -0
- data/lib/skywriter/resource/ec2/customer_gateway.rb +16 -0
- data/lib/skywriter/resource/ec2/dhcp_options.rb +18 -0
- data/lib/skywriter/resource/ec2/eip.rb +14 -0
- data/lib/skywriter/resource/ec2/eip_association.rb +17 -0
- data/lib/skywriter/resource/ec2/instance.rb +34 -0
- data/lib/skywriter/resource/ec2/internet_gateway.rb +13 -0
- data/lib/skywriter/resource/ec2/network_acl.rb +14 -0
- data/lib/skywriter/resource/ec2/network_acl_entry.rb +20 -0
- data/lib/skywriter/resource/ec2/network_interface.rb +20 -0
- data/lib/skywriter/resource/ec2/network_interface_attachment.rb +16 -0
- data/lib/skywriter/resource/ec2/route.rb +17 -0
- data/lib/skywriter/resource/ec2/route_table.rb +14 -0
- data/lib/skywriter/resource/ec2/security_group.rb +17 -0
- data/lib/skywriter/resource/ec2/security_group_egress.rb +23 -0
- data/lib/skywriter/resource/ec2/security_group_ingress.rb +26 -0
- data/lib/skywriter/resource/ec2/subnet.rb +16 -0
- data/lib/skywriter/resource/ec2/subnet_network_acl_association.rb +14 -0
- data/lib/skywriter/resource/ec2/subnet_route_table_association.rb +14 -0
- data/lib/skywriter/resource/ec2/volume.rb +18 -0
- data/lib/skywriter/resource/ec2/volume_attachment.rb +15 -0
- data/lib/skywriter/resource/ec2/vpc.rb +17 -0
- data/lib/skywriter/resource/ec2/vpc_dhcp_options_association.rb +14 -0
- data/lib/skywriter/resource/ec2/vpc_gateway_attachment.rb +15 -0
- data/lib/skywriter/resource/ec2/vpn_connection.rb +17 -0
- data/lib/skywriter/resource/ec2/vpn_connection_route.rb +14 -0
- data/lib/skywriter/resource/ec2/vpn_gateway.rb +14 -0
- data/lib/skywriter/resource/ec2/vpn_gateway_route_propagation.rb +14 -0
- data/lib/skywriter/resource/elasti_cache/cache_cluster.rb +27 -0
- data/lib/skywriter/resource/elastic_beanstalk/application.rb +14 -0
- data/lib/skywriter/resource/elastic_beanstalk/application_version.rb +15 -0
- data/lib/skywriter/resource/elastic_beanstalk/configuration_template.rb +18 -0
- data/lib/skywriter/resource/elastic_beanstalk/environment.rb +21 -0
- data/lib/skywriter/resource/elastic_load_balancing/load_balancer.rb +25 -0
- data/lib/skywriter/resource/elasticache/parameter_group.rb +15 -0
- data/lib/skywriter/resource/elasticache/security_group.rb +13 -0
- data/lib/skywriter/resource/elasticache/security_group_ingress.rb +15 -0
- data/lib/skywriter/resource/elasticache/subnet_group.rb +14 -0
- data/lib/skywriter/resource/iam/access_key.rb +16 -0
- data/lib/skywriter/resource/iam/group.rb +15 -0
- data/lib/skywriter/resource/iam/instance_profile.rb +15 -0
- data/lib/skywriter/resource/iam/policy.rb +18 -0
- data/lib/skywriter/resource/iam/role.rb +13 -0
- data/lib/skywriter/resource/iam/user.rb +17 -0
- data/lib/skywriter/resource/iam/user_to_group_addition.rb +15 -0
- data/lib/skywriter/resource/logical_name_pointer.rb +11 -0
- data/lib/skywriter/resource/pointer.rb +23 -0
- data/lib/skywriter/resource/rds/db_instance.rb +37 -0
- data/lib/skywriter/resource/rds/db_parameter_group.rb +17 -0
- data/lib/skywriter/resource/rds/db_security_group.rb +17 -0
- data/lib/skywriter/resource/rds/db_security_group_ingress.rb +18 -0
- data/lib/skywriter/resource/rds/db_subnet_group.rb +16 -0
- data/lib/skywriter/resource/redshift/cluster.rb +37 -0
- data/lib/skywriter/resource/redshift/cluster_parameter_group.rb +16 -0
- data/lib/skywriter/resource/redshift/cluster_security_group.rb +14 -0
- data/lib/skywriter/resource/redshift/cluster_security_group_ingress.rb +17 -0
- data/lib/skywriter/resource/redshift/cluster_subnet_group.rb +15 -0
- data/lib/skywriter/resource/ref_pointer.rb +11 -0
- data/lib/skywriter/resource/route_53/record_set.rb +24 -0
- data/lib/skywriter/resource/route_53/record_set_group.rb +17 -0
- data/lib/skywriter/resource/s3/bucket.rb +17 -0
- data/lib/skywriter/resource/s3/bucket_policy.rb +15 -0
- data/lib/skywriter/resource/sdb/domain.rb +13 -0
- data/lib/skywriter/resource/sns/topic.rb +16 -0
- data/lib/skywriter/resource/sns/topic_policy.rb +15 -0
- data/lib/skywriter/resource/sqs/queue.rb +18 -0
- data/lib/skywriter/resource/sqs/queue_policy.rb +15 -0
- data/lib/skywriter/resource.rb +165 -0
- data/lib/skywriter/resource_property/README.md +64 -0
- data/lib/skywriter/resource_property/auto_scaling/block_device_mapping.rb +12 -0
- data/lib/skywriter/resource_property/auto_scaling/ebs_block_device.rb +17 -0
- data/lib/skywriter/resource_property/auto_scaling/notification_configuration.rb +11 -0
- data/lib/skywriter/resource_property/auto_scaling/tag.rb +15 -0
- data/lib/skywriter/resource_property/cloud_formation/resource_tag.rb +12 -0
- data/lib/skywriter/resource_property/cloud_front/cache_behavior.rb +14 -0
- data/lib/skywriter/resource_property/cloud_front/custom_origin.rb +11 -0
- data/lib/skywriter/resource_property/cloud_front/default_cache_behavior.rb +13 -0
- data/lib/skywriter/resource_property/cloud_front/distribution_config.rb +16 -0
- data/lib/skywriter/resource_property/cloud_front/forwarded_value.rb +13 -0
- data/lib/skywriter/resource_property/cloud_front/logging.rb +10 -0
- data/lib/skywriter/resource_property/cloud_front/origin.rb +12 -0
- data/lib/skywriter/resource_property/cloud_front/s3_origin.rb +9 -0
- data/lib/skywriter/resource_property/cloud_watch/metric_dimension.rb +10 -0
- data/lib/skywriter/resource_property/dynamo_db/attribute_definition.rb +12 -0
- data/lib/skywriter/resource_property/dynamo_db/global_secondary_index.rb +14 -0
- data/lib/skywriter/resource_property/dynamo_db/key_schema.rb +10 -0
- data/lib/skywriter/resource_property/dynamo_db/local_secondary_index.rb +13 -0
- data/lib/skywriter/resource_property/dynamo_db/projection.rb +12 -0
- data/lib/skywriter/resource_property/dynamo_db/provisioned_throughput.rb +10 -0
- data/lib/skywriter/resource_property/ec2/block_device_mapping.rb +12 -0
- data/lib/skywriter/resource_property/ec2/ebs_block_device.rb +15 -0
- data/lib/skywriter/resource_property/ec2/icmp.rb +10 -0
- data/lib/skywriter/resource_property/ec2/mount_point.rb +10 -0
- data/lib/skywriter/resource_property/ec2/network_interface.rb +18 -0
- data/lib/skywriter/resource_property/ec2/network_interface_association.rb +12 -0
- data/lib/skywriter/resource_property/ec2/network_interface_attachment.rb +10 -0
- data/lib/skywriter/resource_property/ec2/network_interface_group_item.rb +10 -0
- data/lib/skywriter/resource_property/ec2/network_interface_private_ip_specification.rb +10 -0
- data/lib/skywriter/resource_property/ec2/port_range.rb +10 -0
- data/lib/skywriter/resource_property/ec2/security_group_rule.rb +12 -0
- data/lib/skywriter/resource_property/ec2/tag.rb +10 -0
- data/lib/skywriter/resource_property/elastic_beanstalk/environment_tier.rb +11 -0
- data/lib/skywriter/resource_property/elastic_beanstalk/option_setting.rb +13 -0
- data/lib/skywriter/resource_property/elastic_beanstalk/source_bundle.rb +10 -0
- data/lib/skywriter/resource_property/elastic_beanstalk/source_configuration.rb +10 -0
- data/lib/skywriter/resource_property/elastic_load_balancing/app_cookie_stickiness_policy.rb +10 -0
- data/lib/skywriter/resource_property/elastic_load_balancing/health_check.rb +13 -0
- data/lib/skywriter/resource_property/elastic_load_balancing/lb_cookie_stickiness_policy.rb +10 -0
- data/lib/skywriter/resource_property/elastic_load_balancing/listener.rb +14 -0
- data/lib/skywriter/resource_property/elastic_load_balancing/policy.rb +13 -0
- data/lib/skywriter/resource_property/rds/security_group_rule.rb +12 -0
- data/lib/skywriter/resource_property/redshift/parameter.rb +10 -0
- data/lib/skywriter/resource_property/route53/alias_target.rb +10 -0
- data/lib/skywriter/resource_property/s3/website_configuration_policy.rb +16 -0
- data/lib/skywriter/resource_property/sns/subscription.rb +10 -0
- data/lib/skywriter/resource_property/sqs/redrive_policy.rb +10 -0
- data/lib/skywriter/resource_property.rb +57 -0
- data/lib/skywriter/template.rb +143 -0
- data/lib/skywriter/version.rb +3 -0
- data/lib/skywriter.rb +8 -0
- data/skywriter.gemspec +29 -0
- data/spec/skywriter/function_spec.rb +99 -0
- data/spec/skywriter/resource/cloud_formation/authentication_spec.rb +36 -0
- data/spec/skywriter/resource/cloud_formation/custom_resource_spec.rb +30 -0
- data/spec/skywriter/resource/logical_name_pointer_spec.rb +15 -0
- data/spec/skywriter/resource/ref_pointer_spec.rb +15 -0
- data/spec/skywriter/resource_property/ec2/security_group_rule_spec.rb +7 -0
- data/spec/skywriter/resource_property_spec.rb +153 -0
- data/spec/skywriter/resource_spec.rb +236 -0
- data/spec/skywriter/template_spec.rb +246 -0
- data/spec/spec_helper.rb +29 -0
- metadata +306 -0
@@ -0,0 +1,18 @@
|
|
1
|
+
module Skywriter
|
2
|
+
module Resource
|
3
|
+
module IAM
|
4
|
+
# AWS::IAM::Policy Resource
|
5
|
+
#
|
6
|
+
class Policy
|
7
|
+
include Skywriter::Resource
|
8
|
+
|
9
|
+
property :Groups
|
10
|
+
property :PolicyDocument
|
11
|
+
property :PolicyName
|
12
|
+
property :Roles
|
13
|
+
property :Users
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Skywriter
|
2
|
+
module Resource
|
3
|
+
class Pointer
|
4
|
+
attr_reader :resource
|
5
|
+
|
6
|
+
def initialize(resource)
|
7
|
+
@resource = resource
|
8
|
+
end
|
9
|
+
|
10
|
+
def as_json(*)
|
11
|
+
context.register_dependency(resource) unless context.nil?
|
12
|
+
|
13
|
+
return json_fragment
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def context
|
19
|
+
Thread.current[:skywriter_as_json_context]
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module Skywriter
|
2
|
+
module Resource
|
3
|
+
module RDS
|
4
|
+
# AWS::RDS::DBInstance Resource
|
5
|
+
#
|
6
|
+
class DBInstance
|
7
|
+
include Skywriter::Resource
|
8
|
+
|
9
|
+
property :AllocatedStorage
|
10
|
+
property :AutoMinorVersionUpgrade
|
11
|
+
property :AvailabilityZone
|
12
|
+
property :BackupRetentionPeriod
|
13
|
+
property :DBInstanceClass
|
14
|
+
property :DBInstanceIdentifier
|
15
|
+
property :DBName
|
16
|
+
property :DBParameterGroupName
|
17
|
+
property :DBSecurityGroups
|
18
|
+
property :DBSnapshotIdentifier
|
19
|
+
property :DBSubnetGroupName
|
20
|
+
property :Engine
|
21
|
+
property :EngineVersion
|
22
|
+
property :Iops
|
23
|
+
property :LicenseModel
|
24
|
+
property :MasterUsername
|
25
|
+
property :MasterUserPassword
|
26
|
+
property :MultiAZ
|
27
|
+
property :Port
|
28
|
+
property :PreferredBackupWindow
|
29
|
+
property :PreferredMaintenanceWindow
|
30
|
+
property :SourceDBInstanceIdentifier
|
31
|
+
property :Tags
|
32
|
+
property :VPCSecurityGroups
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Skywriter
|
2
|
+
module Resource
|
3
|
+
module RDS
|
4
|
+
# AWS::RDS::DBParameterGroup Resource
|
5
|
+
#
|
6
|
+
class DBParameterGroup
|
7
|
+
include Skywriter::Resource
|
8
|
+
|
9
|
+
property :Description
|
10
|
+
property :Family
|
11
|
+
property :Parameters
|
12
|
+
property :Tags
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Skywriter
|
2
|
+
module Resource
|
3
|
+
module RDS
|
4
|
+
# AWS::RDS::DBSecurityGroup Resource
|
5
|
+
#
|
6
|
+
class DBSecurityGroup
|
7
|
+
include Skywriter::Resource
|
8
|
+
|
9
|
+
property :EC2VpcId
|
10
|
+
property :DBSecurityGroupIngress
|
11
|
+
property :GroupDescription
|
12
|
+
property :Tags
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Skywriter
|
2
|
+
module Resource
|
3
|
+
module RDS
|
4
|
+
# AWS::RDS::DBSecurityGroupIngress Resource
|
5
|
+
#
|
6
|
+
class DBSecurityGroupIngress
|
7
|
+
include Skywriter::Resource
|
8
|
+
|
9
|
+
property :CIDRIP
|
10
|
+
property :DBSecurityGroupName
|
11
|
+
property :EC2SecurityGroupId
|
12
|
+
property :EC2SecurityGroupName
|
13
|
+
property :EC2SecurityGroupOwnerId
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Skywriter
|
2
|
+
module Resource
|
3
|
+
module RDS
|
4
|
+
# AWS::RDS::DBSubnetGroup Resource
|
5
|
+
#
|
6
|
+
class DBSubnetGroup
|
7
|
+
include Skywriter::Resource
|
8
|
+
|
9
|
+
property :DBSubnetGroupDescription
|
10
|
+
property :SubnetIds
|
11
|
+
property :Tags
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module Skywriter
|
2
|
+
module Resource
|
3
|
+
module Redshift
|
4
|
+
# AWS::Redshift::Cluster Resource
|
5
|
+
#
|
6
|
+
class Cluster
|
7
|
+
include Skywriter::Resource
|
8
|
+
|
9
|
+
property :AllowVersionUpgrade
|
10
|
+
property :AutomatedSnapshotRetentionPeriod
|
11
|
+
property :AvailabilityZone
|
12
|
+
property :ClusterParameterGroupName
|
13
|
+
property :ClusterSecurityGroups
|
14
|
+
property :ClusterSubnetGroupName
|
15
|
+
property :ClusterType
|
16
|
+
property :ClusterVersion
|
17
|
+
property :DBName
|
18
|
+
property :ElasticIp
|
19
|
+
property :Encrypted
|
20
|
+
property :HsmClientCertificationIdentifier
|
21
|
+
property :HsmConfigurationIdentifier
|
22
|
+
property :MasterUsername
|
23
|
+
property :MasterUserPassword
|
24
|
+
property :NodeType
|
25
|
+
property :NumberOfNodes
|
26
|
+
property :OwnerAccount
|
27
|
+
property :Port
|
28
|
+
property :PreferredMaintenanceWindow
|
29
|
+
property :PubliclyAccessible
|
30
|
+
property :SnapshotClusterIdentifier
|
31
|
+
property :SnapshotIdentifier
|
32
|
+
property :VpcSecurityGroupIds
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Skywriter
|
2
|
+
module Resource
|
3
|
+
module Redshift
|
4
|
+
# AWS::Redshift::ClusterParameterGroup Resource
|
5
|
+
#
|
6
|
+
class ClusterParameterGroup
|
7
|
+
include Skywriter::Resource
|
8
|
+
|
9
|
+
property :Description
|
10
|
+
property :ParameterGroupFamily
|
11
|
+
property :Parameters
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Skywriter
|
2
|
+
module Resource
|
3
|
+
module Redshift
|
4
|
+
# AWS::Redshift::ClusterSecurityGroupIngress Resource
|
5
|
+
#
|
6
|
+
class ClusterSecurityGroupIngress
|
7
|
+
include Skywriter::Resource
|
8
|
+
|
9
|
+
property :ClusterSecurityGroupName
|
10
|
+
property :CIDRIP
|
11
|
+
property :EC2SecurityGroupName
|
12
|
+
property :EC2SecurityGroupOwnerId
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Skywriter
|
2
|
+
module Resource
|
3
|
+
module Route53
|
4
|
+
# AWS::Route53::RecordSet Resource
|
5
|
+
#
|
6
|
+
class RecordSet
|
7
|
+
include Skywriter::Resource
|
8
|
+
|
9
|
+
property :AliasTarget
|
10
|
+
property :Comment
|
11
|
+
property :HostedZoneId
|
12
|
+
property :HostedZoneName
|
13
|
+
property :Name
|
14
|
+
property :Region
|
15
|
+
property :ResourceRecords
|
16
|
+
property :SetIdentifier
|
17
|
+
property :TTL
|
18
|
+
property :Type
|
19
|
+
property :Weight
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Skywriter
|
2
|
+
module Resource
|
3
|
+
module Route53
|
4
|
+
# AWS::Route53::RecordSetGroup Resource
|
5
|
+
#
|
6
|
+
class RecordSetGroup
|
7
|
+
include Skywriter::Resource
|
8
|
+
|
9
|
+
property :HostedZoneId
|
10
|
+
property :HostedZoneName
|
11
|
+
property :RecordSets
|
12
|
+
property :Comment
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Skywriter
|
2
|
+
module Resource
|
3
|
+
module S3
|
4
|
+
# AWS::S3::Bucket Resource
|
5
|
+
#
|
6
|
+
class Bucket
|
7
|
+
include Skywriter::Resource
|
8
|
+
|
9
|
+
property :AccessControl
|
10
|
+
property :BucketName
|
11
|
+
property :Tags
|
12
|
+
property :WebsiteConfiguration
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Skywriter
|
2
|
+
module Resource
|
3
|
+
module SQS
|
4
|
+
# AWS::SQS::Queue Resource
|
5
|
+
#
|
6
|
+
class Queue
|
7
|
+
include Skywriter::Resource
|
8
|
+
|
9
|
+
property :DelaySeconds
|
10
|
+
property :MaximumMessageSize
|
11
|
+
property :MessageRetentionPeriod
|
12
|
+
property :QueueName
|
13
|
+
property :ReceiveMessageWaitTimeSeconds
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|