cody 0.9.6 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/.gitmodules +0 -9
  3. data/CHANGELOG.md +22 -0
  4. data/Gemfile +0 -2
  5. data/cody.gemspec +3 -3
  6. data/lib/cody.rb +4 -8
  7. data/lib/cody/aws_services.rb +1 -1
  8. data/lib/cody/aws_services/helpers.rb +20 -3
  9. data/lib/cody/cli.rb +4 -13
  10. data/lib/cody/{badge.rb → cli/badge.rb} +1 -1
  11. data/lib/cody/{base.rb → cli/base.rb} +9 -3
  12. data/lib/cody/{delete.rb → cli/delete.rb} +3 -3
  13. data/lib/cody/cli/deploy.rb +7 -0
  14. data/lib/cody/cli/help.rb +11 -0
  15. data/lib/cody/{help → cli/help}/deploy.md +0 -0
  16. data/lib/cody/{help → cli/help}/init.md +0 -0
  17. data/lib/cody/{help → cli/help}/logs.md +0 -0
  18. data/lib/cody/{help → cli/help}/start.md +0 -0
  19. data/lib/cody/{help → cli/help}/stop.md +0 -0
  20. data/lib/cody/{init.rb → cli/init.rb} +1 -2
  21. data/lib/cody/{list.rb → cli/list.rb} +23 -4
  22. data/lib/cody/{logs.rb → cli/logs.rb} +3 -2
  23. data/lib/cody/{sequence.rb → cli/sequence.rb} +3 -3
  24. data/lib/cody/{start.rb → cli/start.rb} +3 -3
  25. data/lib/cody/{status.rb → cli/status.rb} +2 -1
  26. data/lib/cody/{stop.rb → cli/stop.rb} +2 -1
  27. data/lib/cody/command.rb +11 -0
  28. data/lib/cody/core.rb +5 -5
  29. data/lib/cody/dsl/base.rb +9 -0
  30. data/lib/cody/dsl/project.rb +67 -49
  31. data/lib/cody/dsl/role.rb +11 -11
  32. data/lib/cody/dsl/schedule.rb +8 -8
  33. data/lib/cody/list/no_builds_project.rb +1 -1
  34. data/lib/cody/list/project.rb +3 -1
  35. data/lib/cody/project.rb +22 -23
  36. data/lib/cody/role.rb +20 -20
  37. data/lib/cody/schedule.rb +37 -37
  38. data/lib/cody/stack.rb +16 -71
  39. data/lib/cody/stack/base.rb +104 -0
  40. data/lib/cody/{create.rb → stack/create.rb} +2 -2
  41. data/lib/cody/{update.rb → stack/update.rb} +2 -2
  42. data/lib/cody/tailer.rb +1 -1
  43. data/lib/cody/version.rb +1 -1
  44. data/lib/template/project/buildspec.yml +1 -1
  45. data/lib/template/project/project.rb.tt +5 -19
  46. metadata +64 -70
  47. data/lib/cody/completer.rb +0 -159
  48. data/lib/cody/completer/script.rb +0 -6
  49. data/lib/cody/completer/script.sh +0 -10
  50. data/lib/cody/deploy.rb +0 -40
  51. data/lib/cody/help.rb +0 -9
  52. data/lib/cody/help/completion.md +0 -22
  53. data/lib/cody/help/completion_script.md +0 -3
  54. data/vendor/aws_data/CHANGELOG.md +0 -7
  55. data/vendor/aws_data/Gemfile +0 -4
  56. data/vendor/aws_data/LICENSE.txt +0 -21
  57. data/vendor/aws_data/README.md +0 -42
  58. data/vendor/aws_data/Rakefile +0 -6
  59. data/vendor/aws_data/aws_data.gemspec +0 -30
  60. data/vendor/aws_data/bin/console +0 -14
  61. data/vendor/aws_data/bin/setup +0 -8
  62. data/vendor/aws_data/lib/aws_data.rb +0 -91
  63. data/vendor/aws_data/lib/aws_data/version.rb +0 -3
  64. data/vendor/aws_data/spec/aws_data_spec.rb +0 -5
  65. data/vendor/aws_data/spec/spec_helper.rb +0 -14
  66. data/vendor/cfn-status/Gemfile +0 -4
  67. data/vendor/cfn-status/LICENSE.txt +0 -21
  68. data/vendor/cfn-status/README.md +0 -56
  69. data/vendor/cfn-status/Rakefile +0 -6
  70. data/vendor/cfn-status/bin/console +0 -14
  71. data/vendor/cfn-status/bin/setup +0 -8
  72. data/vendor/cfn-status/cfn-status.gemspec +0 -30
  73. data/vendor/cfn-status/lib/cfn/aws_service.rb +0 -56
  74. data/vendor/cfn-status/lib/cfn/status.rb +0 -220
  75. data/vendor/cfn-status/lib/cfn/status/version.rb +0 -5
  76. data/vendor/cfn-status/spec/cfn/status_spec.rb +0 -81
  77. data/vendor/cfn-status/spec/fixtures/cfn/stack-events-complete.json +0 -1080
  78. data/vendor/cfn-status/spec/fixtures/cfn/stack-events-in-progress.json +0 -1080
  79. data/vendor/cfn-status/spec/fixtures/cfn/stack-events-update-rollback-complete.json +0 -1086
  80. data/vendor/cfn-status/spec/spec_helper.rb +0 -14
  81. data/vendor/cfn_camelizer/CHANGELOG.md +0 -10
  82. data/vendor/cfn_camelizer/Gemfile +0 -4
  83. data/vendor/cfn_camelizer/LICENSE.txt +0 -21
  84. data/vendor/cfn_camelizer/README.md +0 -40
  85. data/vendor/cfn_camelizer/Rakefile +0 -6
  86. data/vendor/cfn_camelizer/bin/console +0 -14
  87. data/vendor/cfn_camelizer/bin/setup +0 -8
  88. data/vendor/cfn_camelizer/cfn_camelizer.gemspec +0 -32
  89. data/vendor/cfn_camelizer/lib/camelizer.yml +0 -33
  90. data/vendor/cfn_camelizer/lib/cfn_camelizer.rb +0 -92
  91. data/vendor/cfn_camelizer/lib/cfn_camelizer/version.rb +0 -3
  92. data/vendor/cfn_camelizer/spec/cfn_camelizer_spec.rb +0 -79
  93. data/vendor/cfn_camelizer/spec/spec_helper.rb +0 -14
@@ -7,5 +7,14 @@ module Cody::Dsl
7
7
  @full_project_name = options[:full_project_name] # includes -development at the end
8
8
  @properties = default_properties # defaults make project.rb simpler
9
9
  end
10
+
11
+ # In v1.0.0 defaults to not auto-camelize
12
+ def auto_camelize(data)
13
+ if Cody.settings[:auto_camelize]
14
+ CfnCamelizer.transform(data)
15
+ else
16
+ data.deep_stringify_keys!
17
+ end
18
+ end
10
19
  end
11
20
  end
@@ -3,35 +3,50 @@ module Cody::Dsl
3
3
  include Ssm
4
4
 
5
5
  PROPERTIES = %w[
6
- artifacts
7
- badge_enabled
8
- cache
9
- description
10
- encryption_key
11
- environment
12
- logs_config
13
- name
14
- queued_timeout_in_minutes
15
- secondary_artifacts
16
- secondary_sources
17
- service_role
18
- source
19
- tags
20
- timeout_in_minutes
21
- triggers
22
- vpc_config
6
+ Artifacts
7
+ BadgeEnabled
8
+ Cache
9
+ Description
10
+ EncryptionKey
11
+ Environment
12
+ LogsConfig
13
+ Name
14
+ QueuedTimeoutInMinutes
15
+ SecondaryArtifacts
16
+ SecondarySources
17
+ ServiceRole
18
+ Source
19
+ Tags
20
+ TimeoutInMinutes
21
+ Triggers
22
+ VpcConfig
23
23
  ]
24
24
  PROPERTIES.each do |prop|
25
- define_method(prop) do |v|
25
+ define_method(prop.underscore) do |v|
26
26
  @properties[prop.to_sym] = v
27
27
  end
28
28
  end
29
29
 
30
30
  # Convenience wrapper methods
31
31
  def github_url(url)
32
- @properties[:source][:location] = url
32
+ @properties[:Source][:Location] = url
33
33
  end
34
34
 
35
+ # Convenience wrapper methods
36
+ def git_provider(type="GITHUB")
37
+ @properties[:Source][:Type] = type
38
+ end
39
+
40
+ # Convenience wrapper methods
41
+ def git_branch(branch_or_tag)
42
+ @properties[:SourceVersion] = branch_or_tag
43
+ end
44
+
45
+ def buildspec(file=".cody/buildspec.yaml")
46
+ @properties[:Source][:BuildSpec] = file
47
+ end
48
+ alias_method :build_spec, :buildspec
49
+
35
50
  # So it looks like the auth resource property doesnt really get used.
36
51
  # Instead an account level credential is worked. Refer to:
37
52
  # https://github.com/tongueroo/cody/blob/master/readme/github_oauth.md
@@ -39,47 +54,50 @@ module Cody::Dsl
39
54
  # Keeping this method around in case the CloudFormation method works one day,
40
55
  # or end up figuring out to use it properly.
41
56
  def github_token(token)
42
- @properties[:source][:auth][:resource] = token
57
+ @properties[:Source][:Auth][:Resource] = token
43
58
  end
44
59
 
45
60
  def github_source(options={})
46
61
  source = {
47
- type: "GITHUB",
48
- location: options[:location],
49
- git_clone_depth: 1,
50
- git_submodules_config: { fetch_submodules: true },
51
- build_spec: options[:buildspec] || ".cody/buildspec.yml", # options[:buildspec] accounts for type already
52
- report_build_status: true,
62
+ Type: options[:Type] || "GITHUB",
63
+ Location: options[:Location],
64
+ GitCloneDepth: 1,
65
+ GitSubmodulesConfig: { fetch_submodules: true },
66
+ BuildSpec: options[:BuildSpec] || ".cody/buildspec.yml", # options[:Buildspec] accounts for type already
53
67
  }
54
68
 
55
- if options[:oauth_token]
56
- source[:auth] = {
57
- type: "OAUTH",
58
- resource: options[:oauth_token],
69
+ if source[:Type] =~ /GITHUB/
70
+ source[:ReportBuildStatus] = true
71
+ end
72
+
73
+ if options[:OauthToken]
74
+ source[:Auth] = {
75
+ Type: "OAUTH",
76
+ Resource: options[:OauthToken],
59
77
  }
60
78
  end
61
79
 
62
- @properties[:source] = source
80
+ @properties[:Source] = source
63
81
  end
64
82
 
65
83
  def linux_image(name)
66
- linux_environment(image: name)
84
+ linux_environment(Image: name)
67
85
  end
68
86
 
69
87
  def linux_environment(options={})
70
- image = options[:image] || "aws/codebuild/amazonlinux2-x86_64-standard:2.0"
88
+ image = options[:Image] || "aws/codebuild/amazonlinux2-x86_64-standard:2.0"
71
89
  env = {
72
- compute_type: options[:compute_type] || "BUILD_GENERAL1_SMALL",
73
- image_pull_credentials_type: "CODEBUILD", # https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-environment.html#cfn-codebuild-project-environment-imagepullcredentialstype
74
- privileged_mode: true,
75
- image: image,
76
- type: "LINUX_CONTAINER"
90
+ ComputeType: options[:ComputeType] || "BUILD_GENERAL1_SMALL",
91
+ ImagePullCredentialsType: "CODEBUILD", # https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-environment.html#cfn-codebuild-project-environment-imagepullcredentialstype
92
+ PrivilegedMode: true,
93
+ Image: image,
94
+ Type: "LINUX_CONTAINER"
77
95
  }
78
96
  # @mapped_env_vars is in memory
79
- env[:environment_variables] = @mapped_env_vars if @mapped_env_vars
97
+ env[:EnvironmentVariables] = @mapped_env_vars if @mapped_env_vars
80
98
  # options has highest precedence
81
- env[:environment_variables] = options[:environment_variables] if options[:environment_variables]
82
- @properties[:environment] = env
99
+ env[:EnvironmentVariables] = options[:EnvironmentVariables] if options[:EnvironmentVariables]
100
+ @properties[:Environment] = env
83
101
  end
84
102
 
85
103
  def environment_variables(vars)
@@ -87,20 +105,20 @@ module Cody::Dsl
87
105
  @mapped_env_vars = vars.map { |k,v|
88
106
  k, v = k.to_s, v.to_s
89
107
  if v =~ /^ssm:/
90
- { type: "PARAMETER_STORE", name: k, value: v.sub('ssm:','') }
108
+ { Type: "PARAMETER_STORE", Name: k, Value: v.sub('ssm:','') }
91
109
  else
92
- { type: "PLAINTEXT", name: k, value: v }
110
+ { Type: "PLAINTEXT", Name: k, Value: v }
93
111
  end
94
112
  }
95
- @properties[:environment] ||= {}
96
- @properties[:environment][:environment_variables] = @mapped_env_vars
113
+ @properties[:Environment] ||= {}
114
+ @properties[:Environment][:EnvironmentVariables] = @mapped_env_vars
97
115
  end
98
116
 
99
117
  def local_cache(enable=true)
100
118
  cache = if enable
101
119
  {
102
- type: "LOCAL",
103
- modes: [
120
+ Type: "LOCAL",
121
+ Modes: [
104
122
  "LOCAL_DOCKER_LAYER_CACHE",
105
123
  "LOCAL_SOURCE_CACHE",
106
124
  "LOCAL_CUSTOM_CACHE"
@@ -109,11 +127,11 @@ module Cody::Dsl
109
127
  else
110
128
  {type: "NO_CACHE"}
111
129
  end
112
- @properties[:cache] = cache
130
+ @properties[:Cache] = cache
113
131
  end
114
132
 
115
133
  def type
116
- @options[:type]
134
+ @options[:type] # should be lowercase
117
135
  end
118
136
  end
119
137
  end
@@ -1,16 +1,16 @@
1
1
  module Cody::Dsl
2
2
  module Role
3
3
  PROPERTIES = %w[
4
- assume_role_policy_document
5
- managed_policy_arns
6
- max_session_duration
7
- path
8
- permissions_boundary
9
- policies
10
- role_name
4
+ AssumeRolePolicyDocument
5
+ ManagedPolicyArns
6
+ MaxSessionDuration
7
+ Path
8
+ PermissionsBoundary
9
+ Policies
10
+ RoleName
11
11
  ]
12
12
  PROPERTIES.each do |prop|
13
- define_method(prop) do |v|
13
+ define_method(prop.underscore) do |v|
14
14
  @properties[prop.to_sym] = v
15
15
  end
16
16
  end
@@ -27,9 +27,9 @@ module Cody::Dsl
27
27
  # Expands simple string from: logs => logs:*
28
28
  definition = "#{definition}:*" unless definition.include?(':')
29
29
  {
30
- action: [definition],
31
- effect: "Allow",
32
- resource: "*",
30
+ Action: [definition],
31
+ Effect: "Allow",
32
+ Resource: "*",
33
33
  }
34
34
  when Hash
35
35
  definition
@@ -1,16 +1,16 @@
1
1
  module Cody::Dsl
2
2
  module Schedule
3
3
  PROPERTIES = %w[
4
- description
5
- event_pattern
6
- name
7
- role_arn
8
- schedule_expression
9
- state
10
- targets
4
+ Description
5
+ EventPattern
6
+ Name
7
+ RoleArn
8
+ ScheduleExpression
9
+ State
10
+ Targets
11
11
  ]
12
12
  PROPERTIES.each do |prop|
13
- define_method(prop) do |v|
13
+ define_method(prop.underscore) do |v|
14
14
  @properties[prop.to_sym] = v
15
15
  end
16
16
  end
@@ -1,6 +1,6 @@
1
1
  # Represents a project with no builds yet. In this case we just return an info message for the columns.
2
2
  # This allows `cody list` to work without breaking for Fresh projects with zero builds.
3
- class Cody::List
3
+ module Cody::List
4
4
  class NoBuildsProject
5
5
  def method_missing(meth, *args, &block)
6
6
  "no builds"
@@ -1,10 +1,12 @@
1
1
  # Wrap project in object to allow lazy loading of status
2
- class Cody::List
2
+ module Cody::List
3
3
  class Project
4
4
  include Cody::AwsServices
5
5
  extend Memoist
6
6
 
7
7
  delegate :build_status, :start_time, :end_time, to: :build
8
+ alias_method :time, :end_time
9
+ alias_method :status, :build_status
8
10
 
9
11
  attr_reader :name
10
12
  def initialize(name)
@@ -20,40 +20,39 @@ module Cody
20
20
  load_variables
21
21
  evaluate(@project_path)
22
22
  resource = {
23
- code_build: {
24
- type: "AWS::CodeBuild::Project",
25
- properties: @properties
23
+ CodeBuild: {
24
+ Type: "AWS::CodeBuild::Project",
25
+ Properties: @properties
26
26
  }
27
27
  }
28
- CfnCamelizer.transform(resource)
28
+ auto_camelize(resource)
29
29
  end
30
30
 
31
31
  def default_properties
32
32
  {
33
- name: @full_project_name,
34
- description: @full_project_name,
35
- artifacts: { type: "NO_ARTIFACTS" },
36
- service_role: { ref: "IamRole" },
37
- badge_enabled: true,
38
- timeout_in_minutes: 20,
39
- logs_config: {
40
- cloud_watch_logs: {
41
- status: "ENABLED",
33
+ Name: @full_project_name,
34
+ Description: @full_project_name,
35
+ Artifacts: { Type: "NO_ARTIFACTS" },
36
+ ServiceRole: { Ref: "IamRole" },
37
+ BadgeEnabled: true,
38
+ TimeoutInMinutes: 20,
39
+ LogsConfig: {
40
+ CloudWatchLogs: {
41
+ Status: "ENABLED",
42
42
  # the default log group name is thankfully the project name
43
43
  }
44
44
  },
45
- source: {
46
- type: "GITHUB",
45
+ Source: {
46
+ Type: "GITHUB",
47
47
  # location: "", # required
48
- # git_clone_depth: 1,
49
- git_submodules_config: { fetch_submodules: true },
50
- build_spec: build_spec,
51
- # auth doesnt seem to work, refer to https://github.com/tongueroo/cody/blob/master/readme/github_oauth.md
52
- # auth: {
53
- # type: "OAUTH",
54
- # # resource: "", # required
48
+ # GitCloneDepth: 1,
49
+ GitSubmodulesConfig: { FetchSubmodules: true },
50
+ BuildSpec: build_spec,
51
+ # auth doesnt seem to work, refer to https://github.com/tongueroo/cody/blob/master/readme/GithubOauth.md
52
+ # Auth: {
53
+ # Type: "OAUTH",
54
+ # # Resource: "", # required
55
55
  # },
56
- report_build_status: true,
57
56
  }
58
57
  }
59
58
  end
@@ -15,23 +15,23 @@ module Cody
15
15
  def run
16
16
  load_variables
17
17
  evaluate(@role_path) if File.exist?(@role_path)
18
- @properties[:policies] = [{
19
- policy_name: "CodeBuildAccess",
20
- policy_document: {
21
- version: "2012-10-17",
22
- statement: derived_iam_statements
18
+ @properties[:Policies] = [{
19
+ PolicyName: "CodeBuildAccess",
20
+ PolicyDocument: {
21
+ Version: "2012-10-17",
22
+ Statement: derived_iam_statements
23
23
  }
24
24
  }]
25
25
 
26
- @properties[:managed_policy_arns] ||= @managed_policy_arns || default_managed_policy_arns
26
+ @properties[:ManagedPolicyArns] ||= @managed_policy_arns || default_managed_policy_arns
27
27
 
28
28
  resource = {
29
29
  IamRole: {
30
- type: "AWS::IAM::Role",
31
- properties: @properties
30
+ Type: "AWS::IAM::Role",
31
+ Properties: @properties
32
32
  }
33
33
  }
34
- CfnCamelizer.transform(resource)
34
+ auto_camelize(resource)
35
35
  end
36
36
 
37
37
  private
@@ -41,17 +41,17 @@ module Cody
41
41
 
42
42
  def default_properties
43
43
  {
44
- assume_role_policy_document: {
45
- statement: [{
46
- action: ["sts:AssumeRole"],
47
- effect: "Allow",
48
- principal: {
49
- service: ["codebuild.amazonaws.com"]
44
+ AssumeRolePolicyDocument: {
45
+ Statement: [{
46
+ Action: ["sts:AssumeRole"],
47
+ Effect: "Allow",
48
+ Principal: {
49
+ Service: ["codebuild.amazonaws.com"]
50
50
  }
51
51
  }],
52
- version: "2012-10-17"
52
+ Version: "2012-10-17"
53
53
  },
54
- path: "/"
54
+ Path: "/"
55
55
  }
56
56
  end
57
57
 
@@ -61,7 +61,7 @@ module Cody
61
61
 
62
62
  def default_iam_statements
63
63
  [{
64
- action: [
64
+ Action: [
65
65
  "logs:CreateLogGroup",
66
66
  "logs:CreateLogStream",
67
67
  "logs:PutLogEvents",
@@ -69,8 +69,8 @@ module Cody
69
69
  "ssm:DescribeParameters",
70
70
  "ssm:GetParameter*",
71
71
  ],
72
- effect: "Allow",
73
- resource: "*"
72
+ Effect: "Allow",
73
+ Resource: "*"
74
74
  }]
75
75
  end
76
76
 
@@ -17,27 +17,27 @@ module Cody
17
17
  load_variables
18
18
  evaluate(@schedule_path)
19
19
 
20
- @properties[:schedule_expression] = @schedule_expression if @schedule_expression
20
+ @properties[:ScheduleExpression] = @schedule_expression if @schedule_expression
21
21
  set_rule_event! if @rule_event_props
22
22
  return if old_properties == @properties # empty schedule.rb file
23
23
 
24
24
  resource = {
25
- events_rule: {
26
- type: "AWS::Events::Rule",
27
- properties: @properties
25
+ EventsRule: {
26
+ Type: "AWS::Events::Rule",
27
+ Properties: @properties
28
28
  },
29
- events_rule_role: events_rule_role,
29
+ EventsRuleRole: events_rule_role,
30
30
  }
31
- CfnCamelizer.transform(resource)
31
+ auto_camelize(resource)
32
32
  end
33
33
 
34
34
  def set_rule_event!
35
35
  props = @rule_event_props
36
- if props.key?(:detail)
37
- description = props.key?(:description) ? props.delete(:description) : rule_description
38
- rule_props = { event_pattern: props, description: description }
39
- else # if props.key?(:event_pattern)
40
- props[:description] ||= rule_description
36
+ if props.key?(:Detail)
37
+ description = props.key?(:Description) ? props.delete(:Description) : rule_description
38
+ rule_props = { EventPattern: props, description: description }
39
+ else # if props.key?(:EventPattern)
40
+ props[:Description] ||= rule_description
41
41
  rule_props = props
42
42
  end
43
43
 
@@ -48,15 +48,15 @@ module Cody
48
48
  description = "Cody #{@options[:full_project_name]}"
49
49
  name = description.gsub(" ", "-").downcase
50
50
  {
51
- description: "#{description} CodeBuild project",
52
- # event_pattern: ,
53
- name: name,
54
- # schedule_expression: ,
55
- state: "ENABLED",
56
- targets: [{
57
- arn: { "Fn::GetAtt": "CodeBuild.Arn" },
58
- role_arn: { "Fn::GetAtt": "EventsRuleRole.Arn" }, # required for specific CodeBuild target.
59
- id: "CodeBuildTarget",
51
+ Description: "#{description} CodeBuild project",
52
+ # EventPattern: ,
53
+ Name: name,
54
+ # ScheduleExpression: ,
55
+ State: "ENABLED",
56
+ Targets: [{
57
+ Arn: { "Fn::GetAtt": "CodeBuild.Arn" },
58
+ RoleArn: { "Fn::GetAtt": "EventsRuleRole.Arn" }, # required for specific CodeBuild target.
59
+ Id: "CodeBuildTarget",
60
60
  }]
61
61
  }
62
62
  end
@@ -68,25 +68,25 @@ module Cody
68
68
 
69
69
  def events_rule_role
70
70
  {
71
- type: "AWS::IAM::Role",
72
- properties: {
73
- assume_role_policy_document: {
74
- statement: [{
75
- action: [ "sts:AssumeRole" ],
76
- effect: "Allow",
77
- principal: { service: [ "events.amazonaws.com" ] }
71
+ Type: "AWS::IAM::Role",
72
+ Properties: {
73
+ AssumeRolePolicyDocument: {
74
+ Statement: [{
75
+ Action: [ "sts:AssumeRole" ],
76
+ Effect: "Allow",
77
+ Principal: { Service: [ "events.amazonaws.com" ] }
78
78
  }],
79
- version: "2012-10-17"
79
+ Version: "2012-10-17"
80
80
  },
81
- path: "/",
82
- policies: [{
83
- policy_name: "CodeBuildAccess",
84
- policy_document: {
85
- version: "2012-10-17",
86
- statement: [{
87
- action: "codebuild:StartBuild",
88
- effect: "Allow",
89
- resource: "arn:aws:codebuild:#{aws_data.region}:#{aws_data.account}:project/#{@options[:full_project_name]}"
81
+ Path: "/",
82
+ Policies: [{
83
+ PolicyName: "CodeBuildAccess",
84
+ PolicyDocument: {
85
+ Version: "2012-10-17",
86
+ Statement: [{
87
+ Action: "codebuild:StartBuild",
88
+ Effect: "Allow",
89
+ Resource: "arn:aws:codebuild:#{aws_data.region}:#{aws_data.account}:project/#{@options[:full_project_name]}"
90
90
  }]
91
91
  }
92
92
  }]