package cdklabscdkecscodedeploy import ( _jsii_ "github.com/aws/jsii-runtime-go/runtime" _init_ "github.com/cdklabs/cdk-ecs-codedeploy-go/cdklabscdkecscodedeploy/jsii" "github.com/aws/aws-cdk-go/awscdk/v2" "github.com/aws/aws-cdk-go/awscdk/v2/awscloudwatch" "github.com/aws/aws-cdk-go/awscdk/v2/awsec2" "github.com/aws/aws-cdk-go/awscdk/v2/awsiam" "github.com/aws/aws-cdk-go/awscdk/v2/awss3" "github.com/aws/aws-cdk-go/awscdksyntheticsalpha/v2" "github.com/aws/constructs-go/constructs/v10" "github.com/cdklabs/cdk-ecs-codedeploy-go/cdklabscdkecscodedeploy/internal" ) // A CloudWatch Synthetic Canary for monitoring APIs. // Experimental. type ApiCanary interface { awscdksyntheticsalpha.Canary // Bucket where data from each canary run is stored. // Experimental. ArtifactsBucket() awss3.IBucket // The canary ID. // Experimental. CanaryId() *string // The canary Name. // Experimental. CanaryName() *string // The state of the canary. // // For example, 'RUNNING', 'STOPPED', 'NOT STARTED', or 'ERROR'. // Experimental. CanaryState() *string // Access the Connections object. // // Will fail if not a VPC-enabled Canary. // Experimental. Connections() awsec2.Connections // A CloudWatch Alarm that triggers when the duration of the tests exceeds the given threshold over the past 2 periods. // Experimental. DurationAlarm() awscloudwatch.Alarm // Experimental. SetDurationAlarm(val awscloudwatch.Alarm) // The environment this resource belongs to. // // For resources that are created and managed by the CDK // (generally, those created by creating new class instances like Role, Bucket, etc.), // this is always the same as the environment of the stack they belong to; // however, for imported resources // (those obtained from static methods like fromRoleArn, fromBucketName, etc.), // that might be different than the stack they were imported into. // Experimental. Env() *awscdk.ResourceEnvironment // The tree node. // Experimental. Node() constructs.Node // Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource. // // This value will resolve to one of the following: // - a concrete value (e.g. `"my-awesome-bucket"`) // - `undefined`, when a name should be generated by CloudFormation // - a concrete name generated automatically during synthesis, in // cross-environment scenarios. // Experimental. PhysicalName() *string // Execution role associated with this Canary. // Experimental. Role() awsiam.IRole // The stack in which this resource is defined. // Experimental. Stack() awscdk.Stack // A CloudWatch Alarm that triggers when the success rate falls below 100% over the past 2 periods. // Experimental. SuccessAlarm() awscloudwatch.Alarm // Experimental. SetSuccessAlarm(val awscloudwatch.Alarm) // Add a new test step to this canary. // Experimental. AddTestStep(step *ApiTestStep) // Apply the given removal policy to this resource. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). // Experimental. ApplyRemovalPolicy(policy awscdk.RemovalPolicy) // Experimental. GeneratePhysicalName() *string // Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`). // // Normally, this token will resolve to `arnAttr`, but if the resource is // referenced across environments, `arnComponents` will be used to synthesize // a concrete ARN with the resource's physical name. Make sure to reference // `this.physicalName` in `arnComponents`. // Experimental. GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string // Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`). // // Normally, this token will resolve to `nameAttr`, but if the resource is // referenced across environments, it will be resolved to `this.physicalName`, // which will be a concrete name. // Experimental. GetResourceNameAttribute(nameAttr *string) *string // Measure the Duration of a single canary run, in seconds. // Experimental. MetricDuration(options *awscloudwatch.MetricOptions) awscloudwatch.Metric // Measure the number of failed canary runs over a given time period. // // Default: sum over 5 minutes. // Experimental. MetricFailed(options *awscloudwatch.MetricOptions) awscloudwatch.Metric // Measure the percentage of successful canary runs. // Experimental. MetricSuccessPercent(options *awscloudwatch.MetricOptions) awscloudwatch.Metric // Returns a string representation of this construct. // Experimental. ToString() *string } // The jsii proxy struct for ApiCanary type jsiiProxy_ApiCanary struct { internal.Type__awscdksyntheticsalphaCanary } func (j *jsiiProxy_ApiCanary) ArtifactsBucket() awss3.IBucket { var returns awss3.IBucket _jsii_.Get( j, "artifactsBucket", &returns, ) return returns } func (j *jsiiProxy_ApiCanary) CanaryId() *string { var returns *string _jsii_.Get( j, "canaryId", &returns, ) return returns } func (j *jsiiProxy_ApiCanary) CanaryName() *string { var returns *string _jsii_.Get( j, "canaryName", &returns, ) return returns } func (j *jsiiProxy_ApiCanary) CanaryState() *string { var returns *string _jsii_.Get( j, "canaryState", &returns, ) return returns } func (j *jsiiProxy_ApiCanary) Connections() awsec2.Connections { var returns awsec2.Connections _jsii_.Get( j, "connections", &returns, ) return returns } func (j *jsiiProxy_ApiCanary) DurationAlarm() awscloudwatch.Alarm { var returns awscloudwatch.Alarm _jsii_.Get( j, "durationAlarm", &returns, ) return returns } func (j *jsiiProxy_ApiCanary) Env() *awscdk.ResourceEnvironment { var returns *awscdk.ResourceEnvironment _jsii_.Get( j, "env", &returns, ) return returns } func (j *jsiiProxy_ApiCanary) Node() constructs.Node { var returns constructs.Node _jsii_.Get( j, "node", &returns, ) return returns } func (j *jsiiProxy_ApiCanary) PhysicalName() *string { var returns *string _jsii_.Get( j, "physicalName", &returns, ) return returns } func (j *jsiiProxy_ApiCanary) Role() awsiam.IRole { var returns awsiam.IRole _jsii_.Get( j, "role", &returns, ) return returns } func (j *jsiiProxy_ApiCanary) Stack() awscdk.Stack { var returns awscdk.Stack _jsii_.Get( j, "stack", &returns, ) return returns } func (j *jsiiProxy_ApiCanary) SuccessAlarm() awscloudwatch.Alarm { var returns awscloudwatch.Alarm _jsii_.Get( j, "successAlarm", &returns, ) return returns } // Experimental. func NewApiCanary(scope constructs.Construct, id *string, props *ApiCanaryProps) ApiCanary { _init_.Initialize() if err := validateNewApiCanaryParameters(scope, id, props); err != nil { panic(err) } j := jsiiProxy_ApiCanary{} _jsii_.Create( "@cdklabs/cdk-ecs-codedeploy.ApiCanary", []interface{}{scope, id, props}, &j, ) return &j } // Experimental. func NewApiCanary_Override(a ApiCanary, scope constructs.Construct, id *string, props *ApiCanaryProps) { _init_.Initialize() _jsii_.Create( "@cdklabs/cdk-ecs-codedeploy.ApiCanary", []interface{}{scope, id, props}, a, ) } func (j *jsiiProxy_ApiCanary)SetDurationAlarm(val awscloudwatch.Alarm) { _jsii_.Set( j, "durationAlarm", val, ) } func (j *jsiiProxy_ApiCanary)SetSuccessAlarm(val awscloudwatch.Alarm) { if err := j.validateSetSuccessAlarmParameters(val); err != nil { panic(err) } _jsii_.Set( j, "successAlarm", val, ) } // Checks if `x` is a construct. // // Returns: true if `x` is an object created from a class which extends `Construct`. // Deprecated: use `x instanceof Construct` instead. func ApiCanary_IsConstruct(x interface{}) *bool { _init_.Initialize() if err := validateApiCanary_IsConstructParameters(x); err != nil { panic(err) } var returns *bool _jsii_.StaticInvoke( "@cdklabs/cdk-ecs-codedeploy.ApiCanary", "isConstruct", []interface{}{x}, &returns, ) return returns } // Returns true if the construct was created by CDK, and false otherwise. // Experimental. func ApiCanary_IsOwnedResource(construct constructs.IConstruct) *bool { _init_.Initialize() if err := validateApiCanary_IsOwnedResourceParameters(construct); err != nil { panic(err) } var returns *bool _jsii_.StaticInvoke( "@cdklabs/cdk-ecs-codedeploy.ApiCanary", "isOwnedResource", []interface{}{construct}, &returns, ) return returns } // Check whether the given construct is a Resource. // Experimental. func ApiCanary_IsResource(construct constructs.IConstruct) *bool { _init_.Initialize() if err := validateApiCanary_IsResourceParameters(construct); err != nil { panic(err) } var returns *bool _jsii_.StaticInvoke( "@cdklabs/cdk-ecs-codedeploy.ApiCanary", "isResource", []interface{}{construct}, &returns, ) return returns } func (a *jsiiProxy_ApiCanary) AddTestStep(step *ApiTestStep) { if err := a.validateAddTestStepParameters(step); err != nil { panic(err) } _jsii_.InvokeVoid( a, "addTestStep", []interface{}{step}, ) } func (a *jsiiProxy_ApiCanary) ApplyRemovalPolicy(policy awscdk.RemovalPolicy) { if err := a.validateApplyRemovalPolicyParameters(policy); err != nil { panic(err) } _jsii_.InvokeVoid( a, "applyRemovalPolicy", []interface{}{policy}, ) } func (a *jsiiProxy_ApiCanary) GeneratePhysicalName() *string { var returns *string _jsii_.Invoke( a, "generatePhysicalName", nil, // no parameters &returns, ) return returns } func (a *jsiiProxy_ApiCanary) GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string { if err := a.validateGetResourceArnAttributeParameters(arnAttr, arnComponents); err != nil { panic(err) } var returns *string _jsii_.Invoke( a, "getResourceArnAttribute", []interface{}{arnAttr, arnComponents}, &returns, ) return returns } func (a *jsiiProxy_ApiCanary) GetResourceNameAttribute(nameAttr *string) *string { if err := a.validateGetResourceNameAttributeParameters(nameAttr); err != nil { panic(err) } var returns *string _jsii_.Invoke( a, "getResourceNameAttribute", []interface{}{nameAttr}, &returns, ) return returns } func (a *jsiiProxy_ApiCanary) MetricDuration(options *awscloudwatch.MetricOptions) awscloudwatch.Metric { if err := a.validateMetricDurationParameters(options); err != nil { panic(err) } var returns awscloudwatch.Metric _jsii_.Invoke( a, "metricDuration", []interface{}{options}, &returns, ) return returns } func (a *jsiiProxy_ApiCanary) MetricFailed(options *awscloudwatch.MetricOptions) awscloudwatch.Metric { if err := a.validateMetricFailedParameters(options); err != nil { panic(err) } var returns awscloudwatch.Metric _jsii_.Invoke( a, "metricFailed", []interface{}{options}, &returns, ) return returns } func (a *jsiiProxy_ApiCanary) MetricSuccessPercent(options *awscloudwatch.MetricOptions) awscloudwatch.Metric { if err := a.validateMetricSuccessPercentParameters(options); err != nil { panic(err) } var returns awscloudwatch.Metric _jsii_.Invoke( a, "metricSuccessPercent", []interface{}{options}, &returns, ) return returns } func (a *jsiiProxy_ApiCanary) ToString() *string { var returns *string _jsii_.Invoke( a, "toString", nil, // no parameters &returns, ) return returns }