Module: AWS::Metadata
- Defined in:
- lib/aws_metadata.rb,
lib/aws_metadata/version.rb
Constant Summary collapse
- VERSION =
"0.1.2"
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.
-
.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.
69 70 71 |
# File 'lib/aws_metadata.rb', line 69 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.
60 61 62 |
# File 'lib/aws_metadata.rb', line 60 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.
87 88 89 |
# File 'lib/aws_metadata.rb', line 87 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.
78 79 80 |
# File 'lib/aws_metadata.rb', line 78 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.
51 52 53 |
# File 'lib/aws_metadata.rb', line 51 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.
44 45 46 |
# File 'lib/aws_metadata.rb', line 44 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 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 |