-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #94 from klothoplatform/fastapi-postgres
Postgres Construct, FastAPI + Container -> RDS(postgres) supported
- Loading branch information
Showing
23 changed files
with
673 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 1 addition & 17 deletions
18
pkg/k2/constructs/templates/aws/container/bindings/to_klotho.aws.Postgres.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,6 @@ | ||
from: klotho.aws.Container | ||
to: klotho.aws.Postgres | ||
type: read | ||
resources: | ||
TaskDefinition: | ||
ContainerDefinitions[0].Environment: | ||
# - ${...from.resources:TaskDefinition.ContainerDefinitions[0].Environment} | ||
- Name: ${to.inputs:Name}_POSTGRES_ENDPOINT | ||
Value: ${to:outputs.Endpoint} | ||
- Name: ${to.inputs:Name}_POSTGRES_DATABASE | ||
Value: ${to:outputs.DatabaseName} | ||
- Name: ${to.inputs:Name}_POSTGRES_USER | ||
Value: ${to:outputs.Username} | ||
- Name: ${to.inputs:Name}_POSTGRES_PASSWORD | ||
Value: ${to:outputs.Password} | ||
- Name: ${to.inputs:Name}_POSTGRES_PORT | ||
Value: ${to:outputs.Port} | ||
- Name: ${to.inputs:Name}_POSTGRES_CONNECTION_STRING | ||
Value: ${to.outputs:ConnectionString} | ||
|
||
edges: | ||
- from: ${from.resources:Service} | ||
to: ${to.resources:RDSInstance} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
pkg/k2/constructs/templates/aws/fastapi/bindings/to_klotho.aws.Postgres.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from: klotho.aws.FastAPI | ||
to: klotho.aws.Postgres | ||
|
||
edges: | ||
- from: ${from.resources:Service} | ||
to: ${to.resources:RDSInstance} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
pkg/k2/constructs/templates/aws/postgres/bindings/from_klotho.aws.Container.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from: klotho.aws.Container | ||
to: klotho.aws.Postgres | ||
|
||
resources: | ||
SecurityGroup: | ||
properties: | ||
IngressRules: | ||
- CidrBlocks: | ||
- ${to.inputs:Network.Resources.PrivateSubnet1#CidrBlock} | ||
- ${to.inputs:Network.Resources.PrivateSubnet2#CidrBlock} | ||
FromPort: 0 | ||
Protocol: '-1' | ||
ToPort: 0 | ||
Description: Allow ingress traffic from within the default network |
14 changes: 14 additions & 0 deletions
14
pkg/k2/constructs/templates/aws/postgres/bindings/from_klotho.aws.FastAPI.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from: klotho.aws.FastAPI | ||
to: klotho.aws.Postgres | ||
|
||
resources: | ||
SecurityGroup: | ||
properties: | ||
IngressRules: | ||
- CidrBlocks: | ||
- ${to.inputs:Network.Resources.PrivateSubnet1#CidrBlock} | ||
- ${to.inputs:Network.Resources.PrivateSubnet2#CidrBlock} | ||
FromPort: 0 | ||
Protocol: '-1' | ||
ToPort: 0 | ||
Description: Allow ingress traffic from within the default network |
Oops, something went wrong.