Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement IaC feature enpowered by CloudFormation #155

Open
1 of 3 tasks
wafuwafu13 opened this issue Aug 21, 2023 · 4 comments
Open
1 of 3 tasks

Implement IaC feature enpowered by CloudFormation #155

wafuwafu13 opened this issue Aug 21, 2023 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@wafuwafu13
Copy link
Contributor

wafuwafu13 commented Aug 21, 2023

IaC feature enpowered by CloudFormation

Background

https://github.com/awslabs/dynein#infrastracture-as-code---enpowered-by-cloudformation

Infrastracture as Code - enpowered by CloudFormation
NOTE: currently this feature is under development

Infrastracture as Code is a concept that you define code to provision "infrastructures", such as DynamoDB tables, with "declarative" way (On the other hand you can say dy admin create table and dy admin update table commands are "imperative" way).

To manage DynamoDB tables with "declarative" way, dynein provides dy admin plan and dy admin apply commands. Internally dynein executes AWS CloudFormation APIs to provision DynamoDB resources for you.

Interface

The workflow

  1. create template file
$ ls
cfn.yml

$ cat cfn.yml
Resources:
    MyDDB:
        Type: AWS::DynamoDB::Table
        Properties:
            AttributeDefinitions:
            - AttributeName: pk
               AttributeType: S
        KeySchema:
        - AttributeName: pk
           KeyType: HASH
        BillingMode: PAY_PER_REQUEST
  1. dy admin plan

  2. dy admin apply

Roadmap

Tasks

@wafuwafu13 wafuwafu13 self-assigned this Aug 21, 2023
@StoneDot StoneDot added the enhancement New feature or request label Aug 24, 2023
@wafuwafu13
Copy link
Contributor Author

wafuwafu13 commented Aug 31, 2023

[apply] Build a development environment

During development, to eliminate the impact on users, ensure that apply only works when --dev is added.

Expected Behavior:

# just return message
$ dy admin apply
not yet implemented

# develop feature
$ dy admin apply --dev
(something happen)

@wafuwafu13
Copy link
Contributor Author

wafuwafu13 commented Aug 31, 2023

[apply] Load template file

  • Load cfn.yaml or cfn.yml or cfn.json in the same hierarchy where the dy command is executed
  • If not exist, exit(1)

command:

~/path/to/foo
$ ls
cfn.yaml

~/path/to/foo
(for now, just checking existence of file)
$ dy admin apply --dev

@wafuwafu13 wafuwafu13 changed the title Infrastracture as Code - enpowered by CloudFormation Implement IaC feature enpowered by CloudFormation Aug 31, 2023
@wafuwafu13
Copy link
Contributor Author

wafuwafu13 commented Oct 12, 2023

[apply] Execute CreateStack API

https://rusoto.github.io/rusoto/rusoto_cloudformation/trait.CloudFormation.html#tymethod.create_stack

command:

~/path/to/foo
$ ls
cfn.yaml

~/path/to/foo
$ dy admin apply --dev

@tmokmss
Copy link

tmokmss commented Nov 6, 2023

Can we create tables from CFn templates also for DynamoDB local?

It would be really great to have such feature because currently we often have to duplicate DDB table definitions for DDB local, when we manage the actual AWS infrastructure using CDK or CFn.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants