Skip to content

Commit

Permalink
fixed some rds engine bugs and viz graph bugs. Added more rds imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Torres committed Aug 21, 2024
1 parent 08c6162 commit 0bb7c0c
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
],
"compounds": [
{
"name": "Debug: Llotho + infra.py",
"name": "Debug: Klotho + infra.py",
"configurations": [
"Debug: Klotho",
"Python Debugger: Listen"
Expand Down
14 changes: 0 additions & 14 deletions pkg/engine/operational_eval/vertex_path_expand.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,6 @@ func (v *pathExpandVertex) Key() Key {
}

func (v *pathExpandVertex) Evaluate(eval *Evaluator) error {
// if both the source and target are imported resources we can skip the evaluation since its just for context
// we will ensure the edge remains
sourceRes, err := eval.Solution.RawView().Vertex(v.SatisfactionEdge.Source)
if err != nil {
return fmt.Errorf("could not find source resource %s: %w", v.SatisfactionEdge.Source, err)
}
targetRes, err := eval.Solution.RawView().Vertex(v.SatisfactionEdge.Target)
if err != nil {
return fmt.Errorf("could not find target resource %s: %w", v.SatisfactionEdge.Target, err)
}
if sourceRes.Imported && targetRes.Imported {
return eval.Solution.RawView().AddEdge(v.SatisfactionEdge.Source, v.SatisfactionEdge.Target)
}

runner := &pathExpandVertexRunner{Eval: eval}
edgeExpander := &path_selection.EdgeExpand{Ctx: eval.Solution}
return v.runEvaluation(eval, runner, edgeExpander)
Expand Down
2 changes: 1 addition & 1 deletion pkg/infra/iac/templates/aws/rds_instance/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function create(args: Args): aws.rds.Instance {
function properties(object: aws.rds.Instance, args: Args) {
return {
Username: object.username,
Password: object.password,
Password: object.password.apply((password) => password || ''),
CredentialsSecretValue: pulumi.jsonStringify({
username: object.username,
password: object.password,
Expand Down
12 changes: 12 additions & 0 deletions pkg/infra/iac/templates/aws/rds_subnet_group/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,15 @@ function create(args: Args): aws.rds.SubnetGroup {
//TMPL {{- end }}
})
}

function properties(object: aws.rds.SubnetGroup, args: Args) {
return {
DeployedName: object.name,
}
}

type AllProperties = Args & ReturnType<typeof properties>

function importResource(args: AllProperties): aws.rds.SubnetGroup {
return aws.rds.SubnetGroup.get(args.Name, args.DeployedName)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
qualified_type_name: aws:rds_subnet_group
iac_qualified_type: aws:rds/subnetGroup:SubnetGroup

property_mappings:
tags: Tags
name: DeployedName
6 changes: 6 additions & 0 deletions pkg/templates/aws/resources/rds_subnet_group.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ sanitize_name:
}}

properties:
DeployedName:
type: string
configuration_disabled: true
deploy_time: true
required: true

Subnets:
type: list(resource(aws:subnet))
operational_rule:
Expand Down

0 comments on commit 0bb7c0c

Please sign in to comment.