Skip to content

How to dynamically get ARN, and also compose multiple component yml files together? #9

@Suedo

Description

@Suedo

Currently, I am creating a Role for a DynamoDB table that i defined elsewhere using the component aws-dynamodb.
In my aws-iam-role yml file, I am defining the Dynamo DB Resource as:

      Resource:
        - arn:aws:dynamodb:${env:AWS_REGION}:*:table/backend-db-${env.STAGE}
        - arn:aws:dynamodb:${env:AWS_REGION}:*:table/backend-db-${env.STAGE}/index/*

I just found out that we can't use plugins, but how about CLoudformation !REF or !GetAtt to make things more dynamic?

Also, how do I compose multiple serverless-component's yml files together as one ? My basic serverless express project's tree looks like this at the moment:

.
├── ./app.js
├── ./package.json
├── ./permissions
│   └── ./permissions/serverless.yml
├── ./resources
│   └── ./resources/serverless.yml
├── ./serverless.yml
├── ./src
│   ├── ./src/handlers.ts
│   └── ./src/index.ts
├── ./tsconfig.json
└── ./yarn.lock

As you can see, I have multiple serverless.yml files for each of the components I am using (express, IAM, DynamoDB) . How do I compose these together?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions