Module: AWS::Metadata
- Defined in:
- lib/aws_metadata.rb,
lib/aws_metadata/version.rb
Constant Summary collapse
- VERSION =
"0.2.4"
Class Method Summary collapse
-
.aws_identity_stubs_path ⇒ String
Set the path to the aws_identity_stubs.yml.
-
.aws_identity_stubs_path=(aws_identity_stubs_path) ⇒ String
Set the path to the aws_identity_stubs.yml.
-
.cfn_dev_outputs_path ⇒ String
Set the path to the cfn_dev_output.yml file with the keys you have defined as Outputs for your Cloud Formation stack.
-
.cfn_dev_outputs_path=(dev_outputs_path) ⇒ String
Set the path to the cfn_dev_output.yml file with the keys you have defined as Outputs for your Cloud Formation stack.
-
.cfn_stack_name ⇒ String
The stack name as identified by the Stack Name column in the CloudFormation Section of the AWS console.
-
.cfn_stack_name=(stack_name) ⇒ String
Set the stack name as identified by the Stack Name column in the CloudFormation Section of the AWS console.
-
.configure {|self| ... } ⇒ void
For use in a Rails initializer to set the Metadata.cfn_stack_name, Metadata.stub_responses and Metadata.cfn_dev_outputs_path.
-
.disable_cfn_stack_output ⇒ Boolean
The flag whether or not to disable the AWS::StackOutput object and prevent it from loading.
-
.disable_cfn_stack_output=(disable_cfn_stack_output = false) ⇒ Boolean
Set to true to disable the AWS::StackOutput object and prevent it from loading.
-
.stub_responses ⇒ Boolean
The flag whether or not to return canned Instance responses and stubbed StackOutput responses from a cfn_dev_output.yml file.
-
.stub_responses=(stub_responses = false) ⇒ Boolean
Set to true to return canned Instance responses and stubbed StackOutput responses from a cfn_dev_output.yml file.
Class Method Details
.aws_identity_stubs_path ⇒ String
Set the path to the aws_identity_stubs.yml
Defaults to the config directory in a Rails application, or the file in tests/fixtures/aws_identity_stubs.yml if not in a Rails app.
85 86 87 |
# File 'lib/aws_metadata.rb', line 85 def self.aws_identity_stubs_path @aws_identity_stubs_path ||= defined?(Rails) ? Rails.root.join('config') : File.(File.dirname(__FILE__) + '/../test/fixtures') end |
.aws_identity_stubs_path=(aws_identity_stubs_path) ⇒ String
Set the path to the aws_identity_stubs.yml
Only needs to be set if stub_responses is set to true.
76 77 78 |
# File 'lib/aws_metadata.rb', line 76 def self.aws_identity_stubs_path=(aws_identity_stubs_path) @aws_identity_stubs_path = aws_identity_stubs_path end |
.cfn_dev_outputs_path ⇒ String
Set the path to the cfn_dev_output.yml file with the keys you have defined as Outputs for your Cloud Formation stack.
Defaults to the config directory in a Rails application.
103 104 105 |
# File 'lib/aws_metadata.rb', line 103 def self.cfn_dev_outputs_path @dev_outputs_path ||= defined?(Rails) ? Rails.root.join('config') : '' end |
.cfn_dev_outputs_path=(dev_outputs_path) ⇒ String
Set the path to the cfn_dev_output.yml file with the keys you have defined as Outputs for your Cloud Formation stack.
Only needs to be set if stub_responses is set to true.
94 95 96 |
# File 'lib/aws_metadata.rb', line 94 def self.cfn_dev_outputs_path=(dev_outputs_path) @dev_outputs_path = dev_outputs_path end |
.cfn_stack_name ⇒ String
The stack name as identified by the Stack Name column in the CloudFormation Section of the AWS console.
67 68 69 |
# File 'lib/aws_metadata.rb', line 67 def self.cfn_stack_name @stack_name end |
.cfn_stack_name=(stack_name) ⇒ String
Set the stack name as identified by the Stack Name column in the CloudFormation Section of the AWS console.
60 61 62 |
# File 'lib/aws_metadata.rb', line 60 def self.cfn_stack_name=(stack_name) @stack_name = stack_name end |
.configure {|self| ... } ⇒ void
This method returns an undefined value.
For use in a Rails initializer to set the cfn_stack_name, stub_responses and cfn_dev_outputs_path.
19 20 21 22 |
# File 'lib/aws_metadata.rb', line 19 def self.configure yield self AWS::StackOutput.get unless disable_cfn_stack_output end |
.disable_cfn_stack_output ⇒ Boolean
The flag whether or not to disable the AWS::StackOutput object and prevent it from loading.
52 53 54 |
# File 'lib/aws_metadata.rb', line 52 def self.disable_cfn_stack_output @disable_cfn_stack_output end |
.disable_cfn_stack_output=(disable_cfn_stack_output = false) ⇒ Boolean
Set to true to disable the AWS::StackOutput object and prevent it from loading.
44 45 46 |
# File 'lib/aws_metadata.rb', line 44 def self.disable_cfn_stack_output=(disable_cfn_stack_output = false) @disable_cfn_stack_output = disable_cfn_stack_output end |
.stub_responses ⇒ Boolean
The flag whether or not to return canned Instance responses and stubbed StackOutput responses from a cfn_dev_output.yml file.
36 37 38 |
# File 'lib/aws_metadata.rb', line 36 def self.stub_responses @stub_responses end |
.stub_responses=(stub_responses = false) ⇒ Boolean
Set to true to return canned Instance responses and stubbed StackOutput responses from a cfn_dev_output.yml file.
28 29 30 |
# File 'lib/aws_metadata.rb', line 28 def self.stub_responses=(stub_responses = false) @stub_responses = stub_responses end |