terraform-cdk icon indicating copy to clipboard operation
terraform-cdk copied to clipboard

AppConfig Hosted Configuration Version does not return the right deployment version

Open kalos92 opened this issue 1 year ago • 0 comments

Expected Behavior

the result should be 1.

Actual Behavior

application := appconfigapplication.NewAppconfigApplication(stack, jsii.String(project+"apc-application"+env), &appconfigapplication.AppconfigApplicationConfig{
		Name:        jsii.String(project + "application" + env),
		Description: jsii.String("Contains the configuration for mercury lambda"),
		Tags:        tags,
		TagsAll:     tags,
	})

	apcConfigProfile := appconfigconfigurationprofile.NewAppconfigConfigurationProfile(stack, jsii.String(project+"apc-configuration-profile"+env), &appconfigconfigurationprofile.AppconfigConfigurationProfileConfig{
		ApplicationId: application.Id(),
		LocationUri:   jsii.String("hosted"),
		Name:          jsii.String(project + "profile" + env),
		Description:   jsii.String("Configuration of mercury's notification"),
		Tags:          tags,
		TagsAll:       tags,
		Type:          jsii.String("AWS.Freeform"),
		Validator:     &[]*appconfigconfigurationprofile.AppconfigConfigurationProfileValidator{{Type: jsii.String("JSON_SCHEMA"), Content: jsii.String(string(bbytes))}},
	})

	apcConfigurationVersion := appconfighostedconfigurationversion.NewAppconfigHostedConfigurationVersion(stack, jsii.String(project+"apc-hosted-configuration"+env), &appconfighostedconfigurationversion.AppconfigHostedConfigurationVersionConfig{
		ApplicationId:          application.Id(),
		ConfigurationProfileId: apcConfigProfile.ConfigurationProfileId(),
		Content:                jsii.String(string(jbytes)),
		ContentType:            jsii.String("application/json"),
		Description:            jsii.String("Json configuration of what to send to the selected recipients"),
	})

	apcEnv := appconfigenvironment.NewAppconfigEnvironment(stack, jsii.String(project+"apc-environment"+env), &appconfigenvironment.AppconfigEnvironmentConfig{
		ApplicationId: application.Id(),
		Name:          jsii.String(project + "environment" + env),
		Description:   jsii.String("Current configuration of Mercury"),
		Tags:          tags,
	})

	appconfigdeployment.NewAppconfigDeployment(stack, jsii.String(project+"apc-deployment"+env), &appconfigdeployment.AppconfigDeploymentConfig{
		DependsOn:              &[]cdktf.ITerraformDependable{apcConfigurationVersion},
		ApplicationId:          application.Id(),
		ConfigurationProfileId: apcConfigProfile.ConfigurationProfileId(),
		ConfigurationVersion:   apcConfigurationVersion.GetVersionNumber(),
		DeploymentStrategyId:   jsii.String("AppConfig.AllAtOnce"),
		EnvironmentId:          apcEnv.EnvironmentId(),
		Description:            jsii.String("Deploy"),
		Tags:                   tags,
		TagsAll:                tags,
	})

I'm trying to deploy an AWS appconfig configuration, but when deploying the last resource appconfigdeployment is invalid because the ConfigurationVersion is -8.109562212591382e+298

If I try to print the ConfigDeploymentVersionID it gives me something like xxxxx\xxxxx\1 showing the right version. Obviously I am unable to parse the ID at runtime.

Steps to Reproduce

  1. Declare an AWS AppConfig application
  2. Declare an AWS AppConfig ConfigurationProfile
  3. Declare an AWS AppConfig ConfigurationVersion
  4. Declare an AWS AppConfig Environment
  5. Declare an AWS AppConfig Deployment

Versions

language: go cdktf-cli: 0.20.9 node: v18.12.1 cdktf: 0.20.9 constructs: 10.4.2 jsii: 1.104.0 terraform: 1.9.8 arch: arm64 os: darwin 23.3.0 go: go version go1.23.2 darwin/arm64 providers github.com/cdktf/cdktf-provider-aws-go/aws (PREBUILT) terraform provider version: 5.73.0 prebuilt provider version: 19.39.0 cdktf version: ^0.20.0 github.com/cdktf/cdktf-provider-null-go/null (PREBUILT) terraform provider version: 3.2.3 prebuilt provider version: 10.0.1 cdktf version: ^0.20.0

Providers

│ Provider Name │ Provider Version │ CDKTF │ Constraint │ Package Name │ Package Version │ ├───────────────┼──────────────────┼─────────┼────────────┼──────────────────────────────────────────────┼─────────────────┤ │ aws │ 5.73.0 │ ^0.20.0 │ │ github.com/cdktf/cdktf-provider-aws-go/aws │ 19.39.0 │ ├───────────────┼──────────────────┼─────────┼────────────┼──────────────────────────────────────────────┼─────────────────┤ │ null │ 3.2.3 │ ^0.20.0 │ │ github.com/cdktf/cdktf-provider-null-go/null │ 10.0.1 │

Gist

No response

Possible Solutions

No response

Workarounds

No response

Anything Else?

If I try to print the ConfigDeploymentVersionID it gives me something like xxxxx\xxxxx\1 showing the right version. Obviously I am unable to parse the ID at runtime.

References

No response

Help Wanted

  • [ ] I'm interested in contributing a fix myself

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

kalos92 avatar Nov 04 '24 15:11 kalos92