diff --git a/cloud/aws/deploy/resources.go b/cloud/aws/deploy/resources.go index a0b9a4cdc..5267c11bd 100644 --- a/cloud/aws/deploy/resources.go +++ b/cloud/aws/deploy/resources.go @@ -26,9 +26,9 @@ import ( func (a *NitricAwsPulumiProvider) resourcesStore(ctx *pulumi.Context) error { // Build the AWS resource index from the provider information // This will be used to store the ARNs/Identifiers of all resources created by the stack - bucketNameMap := pulumi.StringMap{} + bucketArnMap := pulumi.StringMap{} for name, bucket := range a.Buckets { - bucketNameMap[name] = bucket.Arn + bucketArnMap[name] = bucket.Arn } apiArnMap := pulumi.StringMap{} @@ -85,7 +85,7 @@ func (a *NitricAwsPulumiProvider) resourcesStore(ctx *pulumi.Context) error { // Build the index from the provider information resourceIndexJson := pulumi.All( - bucketNameMap, + bucketArnMap, apiArnMap, apiEndpointMap, websocketArnMap, diff --git a/cloud/aws/deploytf/.nitric/modules/api/outputs.tf b/cloud/aws/deploytf/.nitric/modules/api/outputs.tf index 7cb1bde46..d7b69c329 100644 --- a/cloud/aws/deploytf/.nitric/modules/api/outputs.tf +++ b/cloud/aws/deploytf/.nitric/modules/api/outputs.tf @@ -1,3 +1,7 @@ output "endpoint" { value = aws_apigatewayv2_api.api_gateway.api_endpoint -} \ No newline at end of file +} + +output "arn" { + value = aws_apigatewayv2_api.api_gateway.arn +} diff --git a/cloud/aws/deploytf/.nitric/modules/http_proxy/outputs.tf b/cloud/aws/deploytf/.nitric/modules/http_proxy/outputs.tf index e69de29bb..d773e2d41 100644 --- a/cloud/aws/deploytf/.nitric/modules/http_proxy/outputs.tf +++ b/cloud/aws/deploytf/.nitric/modules/http_proxy/outputs.tf @@ -0,0 +1,7 @@ +output "arn" { + value = aws_apigatewayv2_api.api_gateway.arn +} + +output "endpoint" { + value = aws_apigatewayv2_api.api_gateway.api_endpoint +} diff --git a/cloud/aws/deploytf/.nitric/modules/parameter/main.tf b/cloud/aws/deploytf/.nitric/modules/parameter/main.tf new file mode 100644 index 000000000..483d91727 --- /dev/null +++ b/cloud/aws/deploytf/.nitric/modules/parameter/main.tf @@ -0,0 +1,36 @@ +resource "random_string" "random" { + length = 4 + special = false +} + +locals { + policy_name = "nitric-param-access-${random_string.random.result}" +} + +# Create a new SSM Parameter Store parameter +resource "aws_ssm_parameter" "text_parameter" { + name = var.parameter_name + type = "String" + value = var.parameter_value + data_type = "text" +} + +# Create the access policy +resource "aws_iam_policy" "access_policy" { + name = local.policy_name + policy = jsonencode({ + Version = "2012-10-17" + Statement = [{ + Effect = "Allow" + Action = "ssm:GetParameter" + Resource = aws_ssm_parameter.text_parameter.arn + }] + }) +} + +# Create the role policy attachment +resource "aws_iam_role_policy_attachment" "policy_attachment" { + for_each = var.access_role_names + role = each.value + policy_arn = aws_iam_policy.access_policy.arn +} diff --git a/cloud/aws/deploytf/.nitric/modules/parameter/outputs.tf b/cloud/aws/deploytf/.nitric/modules/parameter/outputs.tf new file mode 100644 index 000000000..e69de29bb diff --git a/cloud/aws/deploytf/.nitric/modules/parameter/variables.tf b/cloud/aws/deploytf/.nitric/modules/parameter/variables.tf new file mode 100644 index 000000000..0bfdb43d9 --- /dev/null +++ b/cloud/aws/deploytf/.nitric/modules/parameter/variables.tf @@ -0,0 +1,14 @@ +variable "parameter_name" { + description = "The name of the parameter" + type = string +} + +variable "access_role_names" { + description = "The names of the roles that can access the parameter" + type = set(string) +} + +variable "parameter_value" { + description = "The text value of the parameter" + type = string +} diff --git a/cloud/aws/deploytf/.nitric/modules/websocket/outputs.tf b/cloud/aws/deploytf/.nitric/modules/websocket/outputs.tf index c66570f67..df46f7f17 100644 --- a/cloud/aws/deploytf/.nitric/modules/websocket/outputs.tf +++ b/cloud/aws/deploytf/.nitric/modules/websocket/outputs.tf @@ -1,9 +1,14 @@ output "websocket_arn" { description = "The ARN of the deployed websocket API" - value = aws_apigatewayv2_api.websocket.arn + value = aws_apigatewayv2_api.websocket.arn +} + +output "endpoint" { + description = "The endpoint of the deployed websocket API" + value = aws_apigatewayv2_api.websocket.api_endpoint } output "websocket_exec_arn" { description = "The Execution ARN of the deployed websocket API" - value = aws_apigatewayv2_api.websocket.execution_arn + value = aws_apigatewayv2_api.websocket.execution_arn } diff --git a/cloud/aws/deploytf/cdktf.json b/cloud/aws/deploytf/cdktf.json index 506715413..5bb9d83d1 100644 --- a/cloud/aws/deploytf/cdktf.json +++ b/cloud/aws/deploytf/cdktf.json @@ -65,6 +65,10 @@ { "name": "sql", "source": "./.nitric/modules/sql" + }, + { + "name": "parameter", + "source": "./.nitric/modules/parameter" } ], "context": {} diff --git a/cloud/aws/deploytf/deploy.go b/cloud/aws/deploytf/deploy.go index 45335d7ce..a848ba68c 100644 --- a/cloud/aws/deploytf/deploy.go +++ b/cloud/aws/deploytf/deploy.go @@ -26,6 +26,7 @@ import ( "github.com/nitrictech/nitric/cloud/aws/common" "github.com/nitrictech/nitric/cloud/aws/deploytf/generated/api" "github.com/nitrictech/nitric/cloud/aws/deploytf/generated/bucket" + "github.com/nitrictech/nitric/cloud/aws/deploytf/generated/http_proxy" "github.com/nitrictech/nitric/cloud/aws/deploytf/generated/keyvalue" "github.com/nitrictech/nitric/cloud/aws/deploytf/generated/queue" rds "github.com/nitrictech/nitric/cloud/aws/deploytf/generated/rds" @@ -56,6 +57,7 @@ type NitricAwsTerraformProvider struct { Apis map[string]api.Api Buckets map[string]bucket.Bucket Topics map[string]topic.Topic + HttpProxies map[string]http_proxy.HttpProxy Schedules map[string]schedule.Schedule Services map[string]service.Service Secrets map[string]secret.Secret @@ -140,7 +142,7 @@ func (a *NitricAwsTerraformProvider) Pre(stack cdktf.TerraformStack, resources [ } func (a *NitricAwsTerraformProvider) Post(stack cdktf.TerraformStack) error { - return nil + return a.resourcesStore(stack) } // // Post - Called after all resources have been created, before the Pulumi Context is concluded diff --git a/cloud/aws/deploytf/generated/api/Api.go b/cloud/aws/deploytf/generated/api/Api.go index 78f5b6b83..1879fe134 100644 --- a/cloud/aws/deploytf/generated/api/Api.go +++ b/cloud/aws/deploytf/generated/api/Api.go @@ -14,6 +14,7 @@ import ( // Source at ./.nitric/modules/api type Api interface { cdktf.TerraformModule + ArnOutput() *string // Experimental. CdktfStack() cdktf.TerraformStack // Experimental. @@ -84,6 +85,16 @@ type jsiiProxy_Api struct { internal.Type__cdktfTerraformModule } +func (j *jsiiProxy_Api) ArnOutput() *string { + var returns *string + _jsii_.Get( + j, + "arnOutput", + &returns, + ) + return returns +} + func (j *jsiiProxy_Api) CdktfStack() cdktf.TerraformStack { var returns cdktf.TerraformStack _jsii_.Get( diff --git a/cloud/aws/deploytf/generated/api/jsii/api-0.0.0.tgz b/cloud/aws/deploytf/generated/api/jsii/api-0.0.0.tgz index 8bcd8c082..a49cf9bc4 100644 Binary files a/cloud/aws/deploytf/generated/api/jsii/api-0.0.0.tgz and b/cloud/aws/deploytf/generated/api/jsii/api-0.0.0.tgz differ diff --git a/cloud/aws/deploytf/generated/api/main.go b/cloud/aws/deploytf/generated/api/main.go index 1b52181dc..d81f50dcf 100644 --- a/cloud/aws/deploytf/generated/api/main.go +++ b/cloud/aws/deploytf/generated/api/main.go @@ -14,6 +14,7 @@ func init() { []_jsii_.Member{ _jsii_.MemberMethod{JsiiMethod: "addOverride", GoMethod: "AddOverride"}, _jsii_.MemberMethod{JsiiMethod: "addProvider", GoMethod: "AddProvider"}, + _jsii_.MemberProperty{JsiiProperty: "arnOutput", GoGetter: "ArnOutput"}, _jsii_.MemberProperty{JsiiProperty: "cdktfStack", GoGetter: "CdktfStack"}, _jsii_.MemberProperty{JsiiProperty: "constructNodeMetadata", GoGetter: "ConstructNodeMetadata"}, _jsii_.MemberProperty{JsiiProperty: "dependsOn", GoGetter: "DependsOn"}, diff --git a/cloud/aws/deploytf/generated/bucket/jsii/bucket-0.0.0.tgz b/cloud/aws/deploytf/generated/bucket/jsii/bucket-0.0.0.tgz index fcf352a77..a130749b3 100644 Binary files a/cloud/aws/deploytf/generated/bucket/jsii/bucket-0.0.0.tgz and b/cloud/aws/deploytf/generated/bucket/jsii/bucket-0.0.0.tgz differ diff --git a/cloud/aws/deploytf/generated/http_proxy/HttpProxy.go b/cloud/aws/deploytf/generated/http_proxy/HttpProxy.go index 0727a7b45..60da68c33 100644 --- a/cloud/aws/deploytf/generated/http_proxy/HttpProxy.go +++ b/cloud/aws/deploytf/generated/http_proxy/HttpProxy.go @@ -14,6 +14,7 @@ import ( // Source at ./.nitric/modules/http_proxy type HttpProxy interface { cdktf.TerraformModule + ArnOutput() *string // Experimental. CdktfStack() cdktf.TerraformStack // Experimental. @@ -22,6 +23,7 @@ type HttpProxy interface { DependsOn() *[]*string // Experimental. SetDependsOn(val *[]*string) + EndpointOutput() *string // Experimental. ForEach() cdktf.ITerraformIterator // Experimental. @@ -79,6 +81,16 @@ type jsiiProxy_HttpProxy struct { internal.Type__cdktfTerraformModule } +func (j *jsiiProxy_HttpProxy) ArnOutput() *string { + var returns *string + _jsii_.Get( + j, + "arnOutput", + &returns, + ) + return returns +} + func (j *jsiiProxy_HttpProxy) CdktfStack() cdktf.TerraformStack { var returns cdktf.TerraformStack _jsii_.Get( @@ -109,6 +121,16 @@ func (j *jsiiProxy_HttpProxy) DependsOn() *[]*string { return returns } +func (j *jsiiProxy_HttpProxy) EndpointOutput() *string { + var returns *string + _jsii_.Get( + j, + "endpointOutput", + &returns, + ) + return returns +} + func (j *jsiiProxy_HttpProxy) ForEach() cdktf.ITerraformIterator { var returns cdktf.ITerraformIterator _jsii_.Get( diff --git a/cloud/aws/deploytf/generated/http_proxy/jsii/http_proxy-0.0.0.tgz b/cloud/aws/deploytf/generated/http_proxy/jsii/http_proxy-0.0.0.tgz index 6fa9446e2..c8ede8e40 100644 Binary files a/cloud/aws/deploytf/generated/http_proxy/jsii/http_proxy-0.0.0.tgz and b/cloud/aws/deploytf/generated/http_proxy/jsii/http_proxy-0.0.0.tgz differ diff --git a/cloud/aws/deploytf/generated/http_proxy/main.go b/cloud/aws/deploytf/generated/http_proxy/main.go index d3cc0b27e..ec44b694e 100644 --- a/cloud/aws/deploytf/generated/http_proxy/main.go +++ b/cloud/aws/deploytf/generated/http_proxy/main.go @@ -14,9 +14,11 @@ func init() { []_jsii_.Member{ _jsii_.MemberMethod{JsiiMethod: "addOverride", GoMethod: "AddOverride"}, _jsii_.MemberMethod{JsiiMethod: "addProvider", GoMethod: "AddProvider"}, + _jsii_.MemberProperty{JsiiProperty: "arnOutput", GoGetter: "ArnOutput"}, _jsii_.MemberProperty{JsiiProperty: "cdktfStack", GoGetter: "CdktfStack"}, _jsii_.MemberProperty{JsiiProperty: "constructNodeMetadata", GoGetter: "ConstructNodeMetadata"}, _jsii_.MemberProperty{JsiiProperty: "dependsOn", GoGetter: "DependsOn"}, + _jsii_.MemberProperty{JsiiProperty: "endpointOutput", GoGetter: "EndpointOutput"}, _jsii_.MemberProperty{JsiiProperty: "forEach", GoGetter: "ForEach"}, _jsii_.MemberProperty{JsiiProperty: "fqn", GoGetter: "Fqn"}, _jsii_.MemberProperty{JsiiProperty: "friendlyUniqueId", GoGetter: "FriendlyUniqueId"}, diff --git a/cloud/aws/deploytf/generated/keyvalue/jsii/keyvalue-0.0.0.tgz b/cloud/aws/deploytf/generated/keyvalue/jsii/keyvalue-0.0.0.tgz index 675b47db9..2524f35be 100644 Binary files a/cloud/aws/deploytf/generated/keyvalue/jsii/keyvalue-0.0.0.tgz and b/cloud/aws/deploytf/generated/keyvalue/jsii/keyvalue-0.0.0.tgz differ diff --git a/cloud/aws/deploytf/generated/parameter/Parameter.go b/cloud/aws/deploytf/generated/parameter/Parameter.go new file mode 100644 index 000000000..ede1b20e7 --- /dev/null +++ b/cloud/aws/deploytf/generated/parameter/Parameter.go @@ -0,0 +1,513 @@ +package parameter + +import ( + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + _init_ "github.com/nitrictech/nitric/cloud/aws/deploytf/generated/parameter/jsii" + + "github.com/aws/constructs-go/constructs/v10" + "github.com/hashicorp/terraform-cdk-go/cdktf" + "github.com/nitrictech/nitric/cloud/aws/deploytf/generated/parameter/internal" +) + +// Defines an Parameter based on a Terraform module. +// +// Source at ./.nitric/modules/parameter +type Parameter interface { + cdktf.TerraformModule + AccessRoleNames() *[]*string + SetAccessRoleNames(val *[]*string) + // Experimental. + CdktfStack() cdktf.TerraformStack + // Experimental. + ConstructNodeMetadata() *map[string]interface{} + // Experimental. + DependsOn() *[]*string + // Experimental. + SetDependsOn(val *[]*string) + // Experimental. + ForEach() cdktf.ITerraformIterator + // Experimental. + SetForEach(val cdktf.ITerraformIterator) + // Experimental. + Fqn() *string + // Experimental. + FriendlyUniqueId() *string + // The tree node. + Node() constructs.Node + ParameterName() *string + SetParameterName(val *string) + ParameterValue() *string + SetParameterValue(val *string) + // Experimental. + Providers() *[]interface{} + // Experimental. + RawOverrides() interface{} + // Experimental. + SkipAssetCreationFromLocalModules() *bool + // Experimental. + Source() *string + // Experimental. + Version() *string + // Experimental. + AddOverride(path *string, value interface{}) + // Experimental. + AddProvider(provider interface{}) + // Experimental. + GetString(output *string) *string + // Experimental. + InterpolationForOutput(moduleOutput *string) cdktf.IResolvable + // Overrides the auto-generated logical ID with a specific ID. + // Experimental. + OverrideLogicalId(newLogicalId *string) + // Resets a previously passed logical Id to use the auto-generated logical id again. + // Experimental. + ResetOverrideLogicalId() + SynthesizeAttributes() *map[string]interface{} + SynthesizeHclAttributes() *map[string]interface{} + // Experimental. + ToHclTerraform() interface{} + // Experimental. + ToMetadata() interface{} + // Returns a string representation of this construct. + ToString() *string + // Experimental. + ToTerraform() interface{} +} + +// The jsii proxy struct for Parameter +type jsiiProxy_Parameter struct { + internal.Type__cdktfTerraformModule +} + +func (j *jsiiProxy_Parameter) AccessRoleNames() *[]*string { + var returns *[]*string + _jsii_.Get( + j, + "accessRoleNames", + &returns, + ) + return returns +} + +func (j *jsiiProxy_Parameter) CdktfStack() cdktf.TerraformStack { + var returns cdktf.TerraformStack + _jsii_.Get( + j, + "cdktfStack", + &returns, + ) + return returns +} + +func (j *jsiiProxy_Parameter) ConstructNodeMetadata() *map[string]interface{} { + var returns *map[string]interface{} + _jsii_.Get( + j, + "constructNodeMetadata", + &returns, + ) + return returns +} + +func (j *jsiiProxy_Parameter) DependsOn() *[]*string { + var returns *[]*string + _jsii_.Get( + j, + "dependsOn", + &returns, + ) + return returns +} + +func (j *jsiiProxy_Parameter) ForEach() cdktf.ITerraformIterator { + var returns cdktf.ITerraformIterator + _jsii_.Get( + j, + "forEach", + &returns, + ) + return returns +} + +func (j *jsiiProxy_Parameter) Fqn() *string { + var returns *string + _jsii_.Get( + j, + "fqn", + &returns, + ) + return returns +} + +func (j *jsiiProxy_Parameter) FriendlyUniqueId() *string { + var returns *string + _jsii_.Get( + j, + "friendlyUniqueId", + &returns, + ) + return returns +} + +func (j *jsiiProxy_Parameter) Node() constructs.Node { + var returns constructs.Node + _jsii_.Get( + j, + "node", + &returns, + ) + return returns +} + +func (j *jsiiProxy_Parameter) ParameterName() *string { + var returns *string + _jsii_.Get( + j, + "parameterName", + &returns, + ) + return returns +} + +func (j *jsiiProxy_Parameter) ParameterValue() *string { + var returns *string + _jsii_.Get( + j, + "parameterValue", + &returns, + ) + return returns +} + +func (j *jsiiProxy_Parameter) Providers() *[]interface{} { + var returns *[]interface{} + _jsii_.Get( + j, + "providers", + &returns, + ) + return returns +} + +func (j *jsiiProxy_Parameter) RawOverrides() interface{} { + var returns interface{} + _jsii_.Get( + j, + "rawOverrides", + &returns, + ) + return returns +} + +func (j *jsiiProxy_Parameter) SkipAssetCreationFromLocalModules() *bool { + var returns *bool + _jsii_.Get( + j, + "skipAssetCreationFromLocalModules", + &returns, + ) + return returns +} + +func (j *jsiiProxy_Parameter) Source() *string { + var returns *string + _jsii_.Get( + j, + "source", + &returns, + ) + return returns +} + +func (j *jsiiProxy_Parameter) Version() *string { + var returns *string + _jsii_.Get( + j, + "version", + &returns, + ) + return returns +} + + +func NewParameter(scope constructs.Construct, id *string, config *ParameterConfig) Parameter { + _init_.Initialize() + + if err := validateNewParameterParameters(scope, id, config); err != nil { + panic(err) + } + j := jsiiProxy_Parameter{} + + _jsii_.Create( + "parameter.Parameter", + []interface{}{scope, id, config}, + &j, + ) + + return &j +} + +func NewParameter_Override(p Parameter, scope constructs.Construct, id *string, config *ParameterConfig) { + _init_.Initialize() + + _jsii_.Create( + "parameter.Parameter", + []interface{}{scope, id, config}, + p, + ) +} + +func (j *jsiiProxy_Parameter)SetAccessRoleNames(val *[]*string) { + if err := j.validateSetAccessRoleNamesParameters(val); err != nil { + panic(err) + } + _jsii_.Set( + j, + "accessRoleNames", + val, + ) +} + +func (j *jsiiProxy_Parameter)SetDependsOn(val *[]*string) { + _jsii_.Set( + j, + "dependsOn", + val, + ) +} + +func (j *jsiiProxy_Parameter)SetForEach(val cdktf.ITerraformIterator) { + _jsii_.Set( + j, + "forEach", + val, + ) +} + +func (j *jsiiProxy_Parameter)SetParameterName(val *string) { + if err := j.validateSetParameterNameParameters(val); err != nil { + panic(err) + } + _jsii_.Set( + j, + "parameterName", + val, + ) +} + +func (j *jsiiProxy_Parameter)SetParameterValue(val *string) { + if err := j.validateSetParameterValueParameters(val); err != nil { + panic(err) + } + _jsii_.Set( + j, + "parameterValue", + val, + ) +} + +// Checks if `x` is a construct. +// +// Use this method instead of `instanceof` to properly detect `Construct` +// instances, even when the construct library is symlinked. +// +// Explanation: in JavaScript, multiple copies of the `constructs` library on +// disk are seen as independent, completely different libraries. As a +// consequence, the class `Construct` in each copy of the `constructs` library +// is seen as a different class, and an instance of one class will not test as +// `instanceof` the other class. `npm install` will not create installations +// like this, but users may manually symlink construct libraries together or +// use a monorepo tool: in those cases, multiple copies of the `constructs` +// library can be accidentally installed, and `instanceof` will behave +// unpredictably. It is safest to avoid using `instanceof`, and using +// this type-testing method instead. +// +// Returns: true if `x` is an object created from a class which extends `Construct`. +func Parameter_IsConstruct(x interface{}) *bool { + _init_.Initialize() + + if err := validateParameter_IsConstructParameters(x); err != nil { + panic(err) + } + var returns *bool + + _jsii_.StaticInvoke( + "parameter.Parameter", + "isConstruct", + []interface{}{x}, + &returns, + ) + + return returns +} + +// Experimental. +func Parameter_IsTerraformElement(x interface{}) *bool { + _init_.Initialize() + + if err := validateParameter_IsTerraformElementParameters(x); err != nil { + panic(err) + } + var returns *bool + + _jsii_.StaticInvoke( + "parameter.Parameter", + "isTerraformElement", + []interface{}{x}, + &returns, + ) + + return returns +} + +func (p *jsiiProxy_Parameter) AddOverride(path *string, value interface{}) { + if err := p.validateAddOverrideParameters(path, value); err != nil { + panic(err) + } + _jsii_.InvokeVoid( + p, + "addOverride", + []interface{}{path, value}, + ) +} + +func (p *jsiiProxy_Parameter) AddProvider(provider interface{}) { + if err := p.validateAddProviderParameters(provider); err != nil { + panic(err) + } + _jsii_.InvokeVoid( + p, + "addProvider", + []interface{}{provider}, + ) +} + +func (p *jsiiProxy_Parameter) GetString(output *string) *string { + if err := p.validateGetStringParameters(output); err != nil { + panic(err) + } + var returns *string + + _jsii_.Invoke( + p, + "getString", + []interface{}{output}, + &returns, + ) + + return returns +} + +func (p *jsiiProxy_Parameter) InterpolationForOutput(moduleOutput *string) cdktf.IResolvable { + if err := p.validateInterpolationForOutputParameters(moduleOutput); err != nil { + panic(err) + } + var returns cdktf.IResolvable + + _jsii_.Invoke( + p, + "interpolationForOutput", + []interface{}{moduleOutput}, + &returns, + ) + + return returns +} + +func (p *jsiiProxy_Parameter) OverrideLogicalId(newLogicalId *string) { + if err := p.validateOverrideLogicalIdParameters(newLogicalId); err != nil { + panic(err) + } + _jsii_.InvokeVoid( + p, + "overrideLogicalId", + []interface{}{newLogicalId}, + ) +} + +func (p *jsiiProxy_Parameter) ResetOverrideLogicalId() { + _jsii_.InvokeVoid( + p, + "resetOverrideLogicalId", + nil, // no parameters + ) +} + +func (p *jsiiProxy_Parameter) SynthesizeAttributes() *map[string]interface{} { + var returns *map[string]interface{} + + _jsii_.Invoke( + p, + "synthesizeAttributes", + nil, // no parameters + &returns, + ) + + return returns +} + +func (p *jsiiProxy_Parameter) SynthesizeHclAttributes() *map[string]interface{} { + var returns *map[string]interface{} + + _jsii_.Invoke( + p, + "synthesizeHclAttributes", + nil, // no parameters + &returns, + ) + + return returns +} + +func (p *jsiiProxy_Parameter) ToHclTerraform() interface{} { + var returns interface{} + + _jsii_.Invoke( + p, + "toHclTerraform", + nil, // no parameters + &returns, + ) + + return returns +} + +func (p *jsiiProxy_Parameter) ToMetadata() interface{} { + var returns interface{} + + _jsii_.Invoke( + p, + "toMetadata", + nil, // no parameters + &returns, + ) + + return returns +} + +func (p *jsiiProxy_Parameter) ToString() *string { + var returns *string + + _jsii_.Invoke( + p, + "toString", + nil, // no parameters + &returns, + ) + + return returns +} + +func (p *jsiiProxy_Parameter) ToTerraform() interface{} { + var returns interface{} + + _jsii_.Invoke( + p, + "toTerraform", + nil, // no parameters + &returns, + ) + + return returns +} + diff --git a/cloud/aws/deploytf/generated/parameter/ParameterConfig.go b/cloud/aws/deploytf/generated/parameter/ParameterConfig.go new file mode 100644 index 000000000..91c388e21 --- /dev/null +++ b/cloud/aws/deploytf/generated/parameter/ParameterConfig.go @@ -0,0 +1,23 @@ +package parameter + +import ( + "github.com/hashicorp/terraform-cdk-go/cdktf" +) + +type ParameterConfig struct { + // Experimental. + DependsOn *[]cdktf.ITerraformDependable `field:"optional" json:"dependsOn" yaml:"dependsOn"` + // Experimental. + ForEach cdktf.ITerraformIterator `field:"optional" json:"forEach" yaml:"forEach"` + // Experimental. + Providers *[]interface{} `field:"optional" json:"providers" yaml:"providers"` + // Experimental. + SkipAssetCreationFromLocalModules *bool `field:"optional" json:"skipAssetCreationFromLocalModules" yaml:"skipAssetCreationFromLocalModules"` + // The names of the roles that can access the parameter. + AccessRoleNames *[]*string `field:"required" json:"accessRoleNames" yaml:"accessRoleNames"` + // The name of the parameter. + ParameterName *string `field:"required" json:"parameterName" yaml:"parameterName"` + // The text value of the parameter. + ParameterValue *string `field:"required" json:"parameterValue" yaml:"parameterValue"` +} + diff --git a/cloud/aws/deploytf/generated/parameter/Parameter__checks.go b/cloud/aws/deploytf/generated/parameter/Parameter__checks.go new file mode 100644 index 000000000..5483afc51 --- /dev/null +++ b/cloud/aws/deploytf/generated/parameter/Parameter__checks.go @@ -0,0 +1,135 @@ +//go:build !no_runtime_type_checking + +package parameter + +import ( + "fmt" + + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + + "github.com/aws/constructs-go/constructs/v10" + "github.com/hashicorp/terraform-cdk-go/cdktf" +) + +func (p *jsiiProxy_Parameter) validateAddOverrideParameters(path *string, value interface{}) error { + if path == nil { + return fmt.Errorf("parameter path is required, but nil was provided") + } + + if value == nil { + return fmt.Errorf("parameter value is required, but nil was provided") + } + + return nil +} + +func (p *jsiiProxy_Parameter) validateAddProviderParameters(provider interface{}) error { + if provider == nil { + return fmt.Errorf("parameter provider is required, but nil was provided") + } + switch provider.(type) { + case cdktf.TerraformProvider: + // ok + case *cdktf.TerraformModuleProvider: + provider := provider.(*cdktf.TerraformModuleProvider) + if err := _jsii_.ValidateStruct(provider, func() string { return "parameter provider" }); err != nil { + return err + } + case cdktf.TerraformModuleProvider: + provider_ := provider.(cdktf.TerraformModuleProvider) + provider := &provider_ + if err := _jsii_.ValidateStruct(provider, func() string { return "parameter provider" }); err != nil { + return err + } + default: + if !_jsii_.IsAnonymousProxy(provider) { + return fmt.Errorf("parameter provider must be one of the allowed types: cdktf.TerraformProvider, *cdktf.TerraformModuleProvider; received %#v (a %T)", provider, provider) + } + } + + return nil +} + +func (p *jsiiProxy_Parameter) validateGetStringParameters(output *string) error { + if output == nil { + return fmt.Errorf("parameter output is required, but nil was provided") + } + + return nil +} + +func (p *jsiiProxy_Parameter) validateInterpolationForOutputParameters(moduleOutput *string) error { + if moduleOutput == nil { + return fmt.Errorf("parameter moduleOutput is required, but nil was provided") + } + + return nil +} + +func (p *jsiiProxy_Parameter) validateOverrideLogicalIdParameters(newLogicalId *string) error { + if newLogicalId == nil { + return fmt.Errorf("parameter newLogicalId is required, but nil was provided") + } + + return nil +} + +func validateParameter_IsConstructParameters(x interface{}) error { + if x == nil { + return fmt.Errorf("parameter x is required, but nil was provided") + } + + return nil +} + +func validateParameter_IsTerraformElementParameters(x interface{}) error { + if x == nil { + return fmt.Errorf("parameter x is required, but nil was provided") + } + + return nil +} + +func (j *jsiiProxy_Parameter) validateSetAccessRoleNamesParameters(val *[]*string) error { + if val == nil { + return fmt.Errorf("parameter val is required, but nil was provided") + } + + return nil +} + +func (j *jsiiProxy_Parameter) validateSetParameterNameParameters(val *string) error { + if val == nil { + return fmt.Errorf("parameter val is required, but nil was provided") + } + + return nil +} + +func (j *jsiiProxy_Parameter) validateSetParameterValueParameters(val *string) error { + if val == nil { + return fmt.Errorf("parameter val is required, but nil was provided") + } + + return nil +} + +func validateNewParameterParameters(scope constructs.Construct, id *string, config *ParameterConfig) error { + if scope == nil { + return fmt.Errorf("parameter scope is required, but nil was provided") + } + + if id == nil { + return fmt.Errorf("parameter id is required, but nil was provided") + } + + if config == nil { + return fmt.Errorf("parameter config is required, but nil was provided") + } + if err := _jsii_.ValidateStruct(config, func() string { return "parameter config" }); err != nil { + return err + } + + return nil +} + diff --git a/cloud/aws/deploytf/generated/parameter/Parameter__no_checks.go b/cloud/aws/deploytf/generated/parameter/Parameter__no_checks.go new file mode 100644 index 000000000..a8b5b9d17 --- /dev/null +++ b/cloud/aws/deploytf/generated/parameter/Parameter__no_checks.go @@ -0,0 +1,50 @@ +//go:build no_runtime_type_checking + +package parameter + +// Building without runtime type checking enabled, so all the below just return nil + +func (p *jsiiProxy_Parameter) validateAddOverrideParameters(path *string, value interface{}) error { + return nil +} + +func (p *jsiiProxy_Parameter) validateAddProviderParameters(provider interface{}) error { + return nil +} + +func (p *jsiiProxy_Parameter) validateGetStringParameters(output *string) error { + return nil +} + +func (p *jsiiProxy_Parameter) validateInterpolationForOutputParameters(moduleOutput *string) error { + return nil +} + +func (p *jsiiProxy_Parameter) validateOverrideLogicalIdParameters(newLogicalId *string) error { + return nil +} + +func validateParameter_IsConstructParameters(x interface{}) error { + return nil +} + +func validateParameter_IsTerraformElementParameters(x interface{}) error { + return nil +} + +func (j *jsiiProxy_Parameter) validateSetAccessRoleNamesParameters(val *[]*string) error { + return nil +} + +func (j *jsiiProxy_Parameter) validateSetParameterNameParameters(val *string) error { + return nil +} + +func (j *jsiiProxy_Parameter) validateSetParameterValueParameters(val *string) error { + return nil +} + +func validateNewParameterParameters(scope constructs.Construct, id *string, config *ParameterConfig) error { + return nil +} + diff --git a/cloud/aws/deploytf/generated/parameter/internal/types.go b/cloud/aws/deploytf/generated/parameter/internal/types.go new file mode 100644 index 000000000..a0d37dd17 --- /dev/null +++ b/cloud/aws/deploytf/generated/parameter/internal/types.go @@ -0,0 +1,5 @@ +package internal +import ( + "github.com/hashicorp/terraform-cdk-go/cdktf" +) +type Type__cdktfTerraformModule = cdktf.TerraformModule diff --git a/cloud/aws/deploytf/generated/parameter/jsii/jsii.go b/cloud/aws/deploytf/generated/parameter/jsii/jsii.go new file mode 100644 index 000000000..7eaf041bf --- /dev/null +++ b/cloud/aws/deploytf/generated/parameter/jsii/jsii.go @@ -0,0 +1,28 @@ +// Package jsii contains the functionaility needed for jsii packages to +// initialize their dependencies and themselves. Users should never need to use this package +// directly. If you find you need to - please report a bug at +// https://github.com/aws/jsii/issues/new/choose +package jsii + +import ( + _ "embed" + + _jsii_ "github.com/aws/jsii-runtime-go/runtime" + + constructs "github.com/aws/constructs-go/constructs/v10/jsii" + cdktf "github.com/hashicorp/terraform-cdk-go/cdktf/jsii" +) + +//go:embed parameter-0.0.0.tgz +var tarball []byte + +// Initialize loads the necessary packages in the @jsii/kernel to support the enclosing module. +// The implementation is idempotent (and hence safe to be called over and over). +func Initialize() { + // Ensure all dependencies are initialized + cdktf.Initialize() + constructs.Initialize() + + // Load this library into the kernel + _jsii_.Load("parameter", "0.0.0", tarball) +} diff --git a/cloud/aws/deploytf/generated/parameter/jsii/parameter-0.0.0.tgz b/cloud/aws/deploytf/generated/parameter/jsii/parameter-0.0.0.tgz new file mode 100644 index 000000000..c3e64d4e6 Binary files /dev/null and b/cloud/aws/deploytf/generated/parameter/jsii/parameter-0.0.0.tgz differ diff --git a/cloud/aws/deploytf/generated/parameter/main.go b/cloud/aws/deploytf/generated/parameter/main.go new file mode 100644 index 000000000..fa22ddb85 --- /dev/null +++ b/cloud/aws/deploytf/generated/parameter/main.go @@ -0,0 +1,53 @@ +// parameter +package parameter + +import ( + "reflect" + + _jsii_ "github.com/aws/jsii-runtime-go/runtime" +) + +func init() { + _jsii_.RegisterClass( + "parameter.Parameter", + reflect.TypeOf((*Parameter)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberProperty{JsiiProperty: "accessRoleNames", GoGetter: "AccessRoleNames"}, + _jsii_.MemberMethod{JsiiMethod: "addOverride", GoMethod: "AddOverride"}, + _jsii_.MemberMethod{JsiiMethod: "addProvider", GoMethod: "AddProvider"}, + _jsii_.MemberProperty{JsiiProperty: "cdktfStack", GoGetter: "CdktfStack"}, + _jsii_.MemberProperty{JsiiProperty: "constructNodeMetadata", GoGetter: "ConstructNodeMetadata"}, + _jsii_.MemberProperty{JsiiProperty: "dependsOn", GoGetter: "DependsOn"}, + _jsii_.MemberProperty{JsiiProperty: "forEach", GoGetter: "ForEach"}, + _jsii_.MemberProperty{JsiiProperty: "fqn", GoGetter: "Fqn"}, + _jsii_.MemberProperty{JsiiProperty: "friendlyUniqueId", GoGetter: "FriendlyUniqueId"}, + _jsii_.MemberMethod{JsiiMethod: "getString", GoMethod: "GetString"}, + _jsii_.MemberMethod{JsiiMethod: "interpolationForOutput", GoMethod: "InterpolationForOutput"}, + _jsii_.MemberProperty{JsiiProperty: "node", GoGetter: "Node"}, + _jsii_.MemberMethod{JsiiMethod: "overrideLogicalId", GoMethod: "OverrideLogicalId"}, + _jsii_.MemberProperty{JsiiProperty: "parameterName", GoGetter: "ParameterName"}, + _jsii_.MemberProperty{JsiiProperty: "parameterValue", GoGetter: "ParameterValue"}, + _jsii_.MemberProperty{JsiiProperty: "providers", GoGetter: "Providers"}, + _jsii_.MemberProperty{JsiiProperty: "rawOverrides", GoGetter: "RawOverrides"}, + _jsii_.MemberMethod{JsiiMethod: "resetOverrideLogicalId", GoMethod: "ResetOverrideLogicalId"}, + _jsii_.MemberProperty{JsiiProperty: "skipAssetCreationFromLocalModules", GoGetter: "SkipAssetCreationFromLocalModules"}, + _jsii_.MemberProperty{JsiiProperty: "source", GoGetter: "Source"}, + _jsii_.MemberMethod{JsiiMethod: "synthesizeAttributes", GoMethod: "SynthesizeAttributes"}, + _jsii_.MemberMethod{JsiiMethod: "synthesizeHclAttributes", GoMethod: "SynthesizeHclAttributes"}, + _jsii_.MemberMethod{JsiiMethod: "toHclTerraform", GoMethod: "ToHclTerraform"}, + _jsii_.MemberMethod{JsiiMethod: "toMetadata", GoMethod: "ToMetadata"}, + _jsii_.MemberMethod{JsiiMethod: "toString", GoMethod: "ToString"}, + _jsii_.MemberMethod{JsiiMethod: "toTerraform", GoMethod: "ToTerraform"}, + _jsii_.MemberProperty{JsiiProperty: "version", GoGetter: "Version"}, + }, + func() interface{} { + j := jsiiProxy_Parameter{} + _jsii_.InitJsiiProxy(&j.Type__cdktfTerraformModule) + return &j + }, + ) + _jsii_.RegisterStruct( + "parameter.ParameterConfig", + reflect.TypeOf((*ParameterConfig)(nil)).Elem(), + ) +} diff --git a/cloud/aws/deploytf/generated/parameter/version b/cloud/aws/deploytf/generated/parameter/version new file mode 100644 index 000000000..77d6f4ca2 --- /dev/null +++ b/cloud/aws/deploytf/generated/parameter/version @@ -0,0 +1 @@ +0.0.0 diff --git a/cloud/aws/deploytf/generated/policy/jsii/policy-0.0.0.tgz b/cloud/aws/deploytf/generated/policy/jsii/policy-0.0.0.tgz index 3e0b794f2..53e0af7cf 100644 Binary files a/cloud/aws/deploytf/generated/policy/jsii/policy-0.0.0.tgz and b/cloud/aws/deploytf/generated/policy/jsii/policy-0.0.0.tgz differ diff --git a/cloud/aws/deploytf/generated/queue/jsii/queue-0.0.0.tgz b/cloud/aws/deploytf/generated/queue/jsii/queue-0.0.0.tgz index 235a7ab9c..ed64f5568 100644 Binary files a/cloud/aws/deploytf/generated/queue/jsii/queue-0.0.0.tgz and b/cloud/aws/deploytf/generated/queue/jsii/queue-0.0.0.tgz differ diff --git a/cloud/aws/deploytf/generated/rds/jsii/rds-0.0.0.tgz b/cloud/aws/deploytf/generated/rds/jsii/rds-0.0.0.tgz index 06ab8df06..fa3c0c7dd 100644 Binary files a/cloud/aws/deploytf/generated/rds/jsii/rds-0.0.0.tgz and b/cloud/aws/deploytf/generated/rds/jsii/rds-0.0.0.tgz differ diff --git a/cloud/aws/deploytf/generated/schedule/jsii/schedule-0.0.0.tgz b/cloud/aws/deploytf/generated/schedule/jsii/schedule-0.0.0.tgz index ff7c1faef..ba86ec527 100644 Binary files a/cloud/aws/deploytf/generated/schedule/jsii/schedule-0.0.0.tgz and b/cloud/aws/deploytf/generated/schedule/jsii/schedule-0.0.0.tgz differ diff --git a/cloud/aws/deploytf/generated/secret/jsii/secret-0.0.0.tgz b/cloud/aws/deploytf/generated/secret/jsii/secret-0.0.0.tgz index 26e3f8174..3ed698c63 100644 Binary files a/cloud/aws/deploytf/generated/secret/jsii/secret-0.0.0.tgz and b/cloud/aws/deploytf/generated/secret/jsii/secret-0.0.0.tgz differ diff --git a/cloud/aws/deploytf/generated/service/jsii/service-0.0.0.tgz b/cloud/aws/deploytf/generated/service/jsii/service-0.0.0.tgz index 874cdbab1..1ec2ff640 100644 Binary files a/cloud/aws/deploytf/generated/service/jsii/service-0.0.0.tgz and b/cloud/aws/deploytf/generated/service/jsii/service-0.0.0.tgz differ diff --git a/cloud/aws/deploytf/generated/sql/jsii/sql-0.0.0.tgz b/cloud/aws/deploytf/generated/sql/jsii/sql-0.0.0.tgz index 8cf1af258..2f29b89dc 100644 Binary files a/cloud/aws/deploytf/generated/sql/jsii/sql-0.0.0.tgz and b/cloud/aws/deploytf/generated/sql/jsii/sql-0.0.0.tgz differ diff --git a/cloud/aws/deploytf/generated/stack/jsii/stack-0.0.0.tgz b/cloud/aws/deploytf/generated/stack/jsii/stack-0.0.0.tgz index b2c4da89f..d2da02f1c 100644 Binary files a/cloud/aws/deploytf/generated/stack/jsii/stack-0.0.0.tgz and b/cloud/aws/deploytf/generated/stack/jsii/stack-0.0.0.tgz differ diff --git a/cloud/aws/deploytf/generated/topic/jsii/topic-0.0.0.tgz b/cloud/aws/deploytf/generated/topic/jsii/topic-0.0.0.tgz index 70ea41b68..ac17c5db1 100644 Binary files a/cloud/aws/deploytf/generated/topic/jsii/topic-0.0.0.tgz and b/cloud/aws/deploytf/generated/topic/jsii/topic-0.0.0.tgz differ diff --git a/cloud/aws/deploytf/generated/vpc/jsii/vpc-0.0.0.tgz b/cloud/aws/deploytf/generated/vpc/jsii/vpc-0.0.0.tgz index e058e1fdb..b592fe69c 100644 Binary files a/cloud/aws/deploytf/generated/vpc/jsii/vpc-0.0.0.tgz and b/cloud/aws/deploytf/generated/vpc/jsii/vpc-0.0.0.tgz differ diff --git a/cloud/aws/deploytf/generated/websocket/Websocket.go b/cloud/aws/deploytf/generated/websocket/Websocket.go index f0a4591e2..912e907d8 100644 --- a/cloud/aws/deploytf/generated/websocket/Websocket.go +++ b/cloud/aws/deploytf/generated/websocket/Websocket.go @@ -22,6 +22,7 @@ type Websocket interface { DependsOn() *[]*string // Experimental. SetDependsOn(val *[]*string) + EndpointOutput() *string // Experimental. ForEach() cdktf.ITerraformIterator // Experimental. @@ -115,6 +116,16 @@ func (j *jsiiProxy_Websocket) DependsOn() *[]*string { return returns } +func (j *jsiiProxy_Websocket) EndpointOutput() *string { + var returns *string + _jsii_.Get( + j, + "endpointOutput", + &returns, + ) + return returns +} + func (j *jsiiProxy_Websocket) ForEach() cdktf.ITerraformIterator { var returns cdktf.ITerraformIterator _jsii_.Get( diff --git a/cloud/aws/deploytf/generated/websocket/jsii/websocket-0.0.0.tgz b/cloud/aws/deploytf/generated/websocket/jsii/websocket-0.0.0.tgz index c55b8cfe7..c32cd7187 100644 Binary files a/cloud/aws/deploytf/generated/websocket/jsii/websocket-0.0.0.tgz and b/cloud/aws/deploytf/generated/websocket/jsii/websocket-0.0.0.tgz differ diff --git a/cloud/aws/deploytf/generated/websocket/main.go b/cloud/aws/deploytf/generated/websocket/main.go index a105ad137..9d3328f7f 100644 --- a/cloud/aws/deploytf/generated/websocket/main.go +++ b/cloud/aws/deploytf/generated/websocket/main.go @@ -17,6 +17,7 @@ func init() { _jsii_.MemberProperty{JsiiProperty: "cdktfStack", GoGetter: "CdktfStack"}, _jsii_.MemberProperty{JsiiProperty: "constructNodeMetadata", GoGetter: "ConstructNodeMetadata"}, _jsii_.MemberProperty{JsiiProperty: "dependsOn", GoGetter: "DependsOn"}, + _jsii_.MemberProperty{JsiiProperty: "endpointOutput", GoGetter: "EndpointOutput"}, _jsii_.MemberProperty{JsiiProperty: "forEach", GoGetter: "ForEach"}, _jsii_.MemberProperty{JsiiProperty: "fqn", GoGetter: "Fqn"}, _jsii_.MemberProperty{JsiiProperty: "friendlyUniqueId", GoGetter: "FriendlyUniqueId"}, diff --git a/cloud/aws/deploytf/http.go b/cloud/aws/deploytf/http.go index 233f2ba7d..3b317db4a 100644 --- a/cloud/aws/deploytf/http.go +++ b/cloud/aws/deploytf/http.go @@ -22,7 +22,7 @@ import ( ) func (a *NitricAwsTerraformProvider) Http(stack cdktf.TerraformStack, name string, config *deploymentspb.Http) error { - http_proxy.NewHttpProxy(stack, jsii.Sprintf("http_%s", name), &http_proxy.HttpProxyConfig{ + a.HttpProxies[name] = http_proxy.NewHttpProxy(stack, jsii.Sprintf("http_%s", name), &http_proxy.HttpProxyConfig{ StackId: a.Stack.StackIdOutput(), Name: jsii.String(name), TargetLambdaFunction: a.Services[config.Target.GetService()].LambdaArnOutput(), diff --git a/cloud/aws/deploytf/resources.go b/cloud/aws/deploytf/resources.go new file mode 100644 index 000000000..5970fdc48 --- /dev/null +++ b/cloud/aws/deploytf/resources.go @@ -0,0 +1,93 @@ +// Copyright 2021 Nitric Technologies Pty Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package deploytf + +import ( + "encoding/json" + "fmt" + + "github.com/aws/jsii-runtime-go" + "github.com/hashicorp/terraform-cdk-go/cdktf" + "github.com/nitrictech/nitric/cloud/aws/common" + "github.com/nitrictech/nitric/cloud/aws/deploytf/generated/parameter" +) + +func (a *NitricAwsTerraformProvider) resourcesStore(stack cdktf.TerraformStack) error { + + index := common.NewResourceIndex() + + for name, bucket := range a.Buckets { + index.Buckets[name] = *bucket.BucketArnOutput() + } + + for name, api := range a.Apis { + index.Apis[name] = common.ApiGateway{ + Arn: *api.ArnOutput(), + Endpoint: *api.EndpointOutput(), + } + } + + for name, ws := range a.Websockets { + index.Websockets[name] = common.ApiGateway{ + Arn: *ws.WebsocketArnOutput(), + Endpoint: *ws.EndpointOutput(), + } + } + + for name, proxy := range a.HttpProxies { + index.HttpProxies[name] = common.ApiGateway{ + Arn: *proxy.ArnOutput(), + Endpoint: *proxy.EndpointOutput(), + } + } + + for name, topic := range a.Topics { + index.Topics[name] = common.Topic{ + Arn: *topic.TopicArnOutput(), + StateMachineArn: *topic.SfnArnOutput(), + } + } + + for name, kv := range a.KeyValueStores { + index.KvStores[name] = *kv.KvArnOutput() + } + + for name, queue := range a.Queues { + index.Queues[name] = *queue.QueueArnOutput() + } + + for name, secret := range a.Secrets { + index.Secrets[name] = *secret.SecretArnOutput() + } + + indexJson, err := json.Marshal(index) + if err != nil { + return fmt.Errorf("failed to marshal resource index: %v", err) + } + + // Give all the Services access to the resource index + accessRoleNames := []string{} + for _, service := range a.Services { + accessRoleNames = append(accessRoleNames, *service.RoleNameOutput()) + } + + parameter.NewParameter(stack, jsii.String("nitric_resources"), ¶meter.ParameterConfig{ + ParameterName: jsii.Sprintf("/nitric/%s/resource-index", *a.Stack.StackIdOutput()), + ParameterValue: jsii.String(string(indexJson)), + AccessRoleNames: jsii.Strings(accessRoleNames...), + }) + + return nil +} diff --git a/cloud/aws/deploytf/service.go b/cloud/aws/deploytf/service.go index 179ddf7b2..da40adbfa 100644 --- a/cloud/aws/deploytf/service.go +++ b/cloud/aws/deploytf/service.go @@ -47,11 +47,11 @@ func (a *NitricAwsTerraformProvider) Service(stack cdktf.TerraformStack, name st } jsiiEnv := map[string]*string{ - "NITRIC_STACK_ID": a.Stack.StackIdOutput(), - "NITRIC_ENVIRONMENT": jsii.String("cloud"), - "MIN_WORKERS": jsii.String(fmt.Sprint(config.Workers)), - "NITRIC_HTTP_PROXY_PORT": jsii.String(fmt.Sprint(3000)), - "NITRIC_AWS_RESOURCE_RESOLVER": jsii.String("tagging"), + "NITRIC_STACK_ID": a.Stack.StackIdOutput(), + "NITRIC_ENVIRONMENT": jsii.String("cloud"), + "MIN_WORKERS": jsii.String(fmt.Sprint(config.Workers)), + "NITRIC_HTTP_PROXY_PORT": jsii.String(fmt.Sprint(3000)), + // "NITRIC_AWS_RESOURCE_RESOLVER": jsii.String("tagging"), } // TODO: Only apply to requesting services