Skip to content

Conversation

@xydinesh
Copy link

I create this pull request as a result of discussion happened in, StackStorm-Exchange/exchange-incubator#10. Main features in this pull request are,

  • Ability to assume_role for cross account access
  • Ability to specify region for cross region access

For example, I have a st2 deployment in aws account 123456 and us-east-1. I want to deploy VPC in account 456789 and us-west-1.

     assume_role:
        action: aws.assume_role
        input:
           role_arn: “arn:aws:iam:456789:role/st2_role”
        publish:
          credentials: <% task(assume_role).result.result %>
       on-success:
         - create_vpc
    
    create_vpc:
      action: aws.boto3action
      input:
        service: ec2
        action_name: create_vpc
        region: "us-west-1"
        params: <% dict(CidrBlock => "10.0.0.0/16", InstanceTenancy => "default") %>
        credentials: <% $.credentials %>
      publish:
          vpc_id: <% task(create_vpc).result.result.Vpc.VpcId %>
      on-success:
        - create_subnet

    create_subnet:
      action: aws.boto3action
      input:
        service: ec2
        region: "us-west-1"
        action_name: create_subnet
        params: <% dict(AvailabilityZone =>"us-west-1a", CidrBlock =>"10.0.0.0/24", VpcId => $.vpc_id) %>
        credentials: <% $.credentials %>
      publish:
        subnet_ids: <% task(create_subnets).result.result.Subnet.SubnetId %>
      on-success:
         - create_igw

     create_igw:
        action: aws.boto3action
        input:
          service: ec2
          action_name: create_internet_gateway
          region: <% $.region %>
          credentials: <% $.credentials %>
        publish:
          igw_id: <% task(create_igw).result.result.InternetGateway.InternetGatewayId %>

In addition, aws.boto3action created with following opinions.

  • aws credentials
    Boto3 is the official SDK for AWS. As a user/developer, If I have boto3 configured I expect aws pack to work without doing any additional configuration. For example,
st2 pack install aws
st2 run aws.boto3action service="ec2" action_name="decribe_vpcs" region="us-west-1"

In addition, if I want to use use boto3 profiles

st2 run aws.boto3action service="ec2" action_name="decribe_vpcs" region="us-west-1" env="AWS_PROFILE=production"
  • yaml generation
    Long term, I don’t believe yaml generation scale based on the number of services AWS have and introduce. In addition, IMO Boto3 documentation is detailed, has examples. Having yaml for each action is redundant and add no value to the end user.

  • pack maintenance

    Since there are no yaml to generate, this pack should be easy to maintain. Any new service boto3 introduce, available to pack user right away.

boto3action.md Outdated
`aws.boto3action` runs boto3 actions in stackstorm dynamically. It has following features.

- Uses boto3 configurations. Find more information on boto3 configuration in boto3 documentation. http://boto3.readthedocs.io/en/latest/guide/quickstart.html#configuration
- Ablity to run cross region actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ablity -> Ability

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in the latest commit.

boto3action.md Outdated

- Uses boto3 configurations. Find more information on boto3 configuration in boto3 documentation. http://boto3.readthedocs.io/en/latest/guide/quickstart.html#configuration
- Ablity to run cross region actions
- Ablility to run cross account actions.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ability -> Ability

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in the latest commit.

Copy link
Contributor

@warrenvw warrenvw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm asking for a few minor tweaks. Before we merge boto3 into master, we'll make sure that all outstanding issues are resolved, and users are notified of the upcoming changes.

@xydinesh
Copy link
Author

xydinesh commented Aug 7, 2017

@warrenvw Thanks for approving changes. Please let me know if you need anything from me to make progress on this PR.

Copy link

@humblearner humblearner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@warrenvw warrenvw merged commit 3d0adce into StackStorm-Exchange:boto3 Aug 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants