Skip to content

Commit

Permalink
Update cloud/aws/deploytf/api.go
Browse files Browse the repository at this point in the history
Co-authored-by: Rak Siva <[email protected]>
  • Loading branch information
jyecusch and raksiv committed Dec 9, 2024
1 parent 7150b84 commit fadbbf9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cloud/aws/deploytf/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ func (n *NitricAwsTerraformProvider) Api(stack cdktf.TerraformStack, name string
for _, pathOperation := range apiPath.Operations() {
if apiNitricTarget, ok := pathOperation.Extensions["x-nitric-target"]; ok {
if targetMap, isMap := apiNitricTarget.(map[string]any); isMap {
serviceName := targetMap["name"].(string)
serviceName, ok := targetMap["name"].(string)
if !ok {
return fmt.Errorf("missing or invalid 'name' field in x-nitric-target for path %s on API %s", pathOperation.OperationID, name)
}

nitricService, ok := n.Services[serviceName]
if !ok {
Expand Down

0 comments on commit fadbbf9

Please sign in to comment.