Skip to content
v2.278.0

ViolatingConstructJson Struct ​

A construct that violated a policy rule.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { cloud_assembly_schema } from 'aws-cdk-lib';
const violatingConstructJson: cloud_assembly_schema.ViolatingConstructJson = {
  constructPath: 'constructPath',

  // the properties below are optional
  cloudFormationResource: {
    logicalId: 'logicalId',
    templatePath: 'templatePath',

    // the properties below are optional
    propertyPaths: ['propertyPaths'],
  },
  constructFqn: 'constructFqn',
  libraryVersion: 'libraryVersion',
  stackTraces: ['stackTraces'],
};
python
from aws_cdk.cloud_assembly_schema import ViolatingConstructJson, CloudFormationResourceJson
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import cloud_assembly_schema

violating_construct_json = ViolatingConstructJson(
    construct_path="constructPath",

    # the properties below are optional
    cloud_formation_resource=CloudFormationResourceJson(
        logical_id="logicalId",
        template_path="templatePath",

        # the properties below are optional
        property_paths=["propertyPaths"]
    ),
    construct_fqn="constructFqn",
    library_version="libraryVersion",
    stack_traces=["stackTraces"]
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.cloud_assembly_schema.*;

ViolatingConstructJson violatingConstructJson = ViolatingConstructJson.builder()
        .constructPath("constructPath")

        // the properties below are optional
        .cloudFormationResource(CloudFormationResourceJson.builder()
                .logicalId("logicalId")
                .templatePath("templatePath")

                // the properties below are optional
                .propertyPaths(List.of("propertyPaths"))
                .build())
        .constructFqn("constructFqn")
        .libraryVersion("libraryVersion")
        .stackTraces(List.of("stackTraces"))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.Cloud_assembly_schema;

var violatingConstructJson = new ViolatingConstructJson {
    ConstructPath = "constructPath",

    // the properties below are optional
    CloudFormationResource = new CloudFormationResourceJson {
        LogicalId = "logicalId",
        TemplatePath = "templatePath",

        // the properties below are optional
        PropertyPaths = new [] { "propertyPaths" }
    },
    ConstructFqn = "constructFqn",
    LibraryVersion = "libraryVersion",
    StackTraces = new [] { "stackTraces" }
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

violatingConstructJson := &ViolatingConstructJson{
	ConstructPath: jsii.String("constructPath"),

	// the properties below are optional
	CloudFormationResource: &CloudFormationResourceJson{
		LogicalId: jsii.String("logicalId"),
		TemplatePath: jsii.String("templatePath"),

		// the properties below are optional
		PropertyPaths: []*string{
			jsii.String("propertyPaths"),
		},
	},
	ConstructFqn: jsii.String("constructFqn"),
	LibraryVersion: jsii.String("libraryVersion"),
	StackTraces: []*string{
		jsii.String("stackTraces"),
	},
}

Properties ​

cloudFormationResourceoptionalCloudFormationResourceJsoncloud_formation_resourceoptionalCloudFormationResourceJsoncloudFormationResourceoptionalCloudFormationResourceJsonCloudFormationResourceoptionalCloudFormationResourceJsonCloudFormationResourceoptionalCloudFormationResourceJson #
If this construct violation regards a CloudFormation resource, a reference to the resource details.
constructFqnoptionalstringconstruct_fqnoptionalstrconstructFqnoptionalStringConstructFqnoptionalstringConstructFqnoptional*string #
The fully qualified name of the construct class (includes the library name).

Default: no construct info

constructPathstringconstruct_pathstrconstructPathStringConstructPathstringConstructPath*string required #
The construct path as defined in the application.

Default: no construct path

libraryVersionoptionalstringlibrary_versionoptionalstrlibraryVersionoptionalStringLibraryVersionoptionalstringLibraryVersionoptional*string #
The version of the library that contains this construct.

Default: no version info

The library name is the first component of the construct FQN.

stackTracesoptionalstring[]stack_tracesoptionaltyping.List[str]stackTracesoptionalList<String>StackTracesoptionalstring[]StackTracesoptional*[]*string #
Stack traces associated with this violation.

Default: No stack traces

This can be all the stack traces where a violating property got its value, or just the construct creation stack trace.

Every element of the array is a stack trace, where each stack trace is a \n-delimited string.