Class: ESP::AWSClients
- Inherits:
-
Object
- Object
- ESP::AWSClients
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/esp/aws_clients.rb
Constant Summary collapse
- ESP_OWNER_ID =
{ "production" => "613698206329".freeze }.freeze
- AWS_ROLE_NAME =
"Evident-Service-Role-AutoCreate".freeze
- AWS_ROLE_POLICY_ARN =
"arn:aws:iam::aws:policy/SecurityAudit".freeze
Instance Method Summary collapse
Instance Method Details
#create_and_attach_role!(external_account_id) ⇒ Object
13 14 15 16 17 |
# File 'lib/esp/aws_clients.rb', line 13 def create_and_attach_role!(external_account_id) role = iam.create_role(role_name: AWS_ROLE_NAME, assume_role_policy_document: trust_policy(external_account_id)) iam.attach_role_policy(role_name: AWS_ROLE_NAME, policy_arn: AWS_ROLE_POLICY_ARN) role end |
#owner_id ⇒ Object
19 20 21 |
# File 'lib/esp/aws_clients.rb', line 19 def owner_id @owner_id ||= ec2.describe_security_groups.security_groups[0].owner_id end |