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

fixed some rds engine bugs and viz graph bugs. Added more rds imports #1007

Merged
merged 2 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading