Skip to content
This repository was archived by the owner on Dec 5, 2023. It is now read-only.

Latest commit

 

History

History
45 lines (41 loc) · 2.65 KB

File metadata and controls

45 lines (41 loc) · 2.65 KB

Accessing a Honeycode workbook from a different AWS account

You can setup a cross account IAM role to allow access to your Honeycode workbooks for Lambda functions that are deployed in a different, trusted account. Here is an overview of how the sample code will use the cross account role to access your Honeycode workbook:

Amazon Honeycode cross account access

The steps to follow are:

  1. Open the AWS console and login to the account where you are planning to deploy your Lambda functions/sample code
  2. Copy the 12 digit AWS account id for this account
  3. Logout from this account
  4. Login to the AWS account that is connected with your Honeycode team
  5. Open the AWS IAM console
  6. Click on Policies and then click on Create policy
  7. Click on the JSON tab and copy and paste the following policy
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "HoneycodeWorkbookAccess",
            "Effect": "Allow",
            "Action": "honeycode:*",
            "Resource": [
                "arn:aws:honeycode:*:*:workbook:workbook/YOUR_WORKBOOK_ID",
                "arn:aws:honeycode:*:*:table:workbook/YOUR_WORKBOOK_ID/table/*"
            ]
        }
    ]
}
  1. Replace YOUR_WORKBOOK_ID with the Workbook ID that you copied from your Honeycode App
  2. Enter a name such as MyHoneycodeWorkbookLambdaPolicy for this policy.
  3. Click on Create Policy
  4. Click on Roles and click on Create role
  5. Select Another AWS account and enter the account id that you copied in step 2
  6. Click on Next:Permissions
  7. Search for and select the policy that you created in step 9. In this guide we have used the name MyHoneycodeWorkbookLambdaPolicy for the policy

Note: You can also use the managed policy AmazonHoneycodeWorkbookFullAccess instead of creating your own custom policy (steps 6 to 10)if you want to give access to all workbooks in your Honeycode team

  1. Click on Next:Tags and then Next:Review
  2. Enter a Role name such as MyHoneycodeWorkbookLambdaRole and click on Create role
  3. You should see a message that says The role MyHoneycodeWorkbookLambdaRole has been created. Click on the role name in this message to open the role
  4. Copy the Role ARN. This should in the format arn:aws:iam::123456789012:role/MyHoneycodeWorkbookLambdaRole. You will be using this value to update crossAcountHoneycodeRoleArn in env.json file in your Honeycode Table API sample code with this value
  5. Logout of this AWS account
  6. Login back to the account where you will be deploying your sample code including Lamdba using Cloud9 and continue with the rest of the instructions to complete the deployment.