Documentation ¶
Index ¶
- func CfnDBClusterParameterGroup_CFN_RESOURCE_TYPE_NAME() *string
- func CfnDBClusterParameterGroup_IsCfnElement(x interface{}) *bool
- func CfnDBClusterParameterGroup_IsCfnResource(construct constructs.IConstruct) *bool
- func CfnDBClusterParameterGroup_IsConstruct(x interface{}) *bool
- func CfnDBCluster_CFN_RESOURCE_TYPE_NAME() *string
- func CfnDBCluster_IsCfnElement(x interface{}) *bool
- func CfnDBCluster_IsCfnResource(construct constructs.IConstruct) *bool
- func CfnDBCluster_IsConstruct(x interface{}) *bool
- func CfnDBInstance_CFN_RESOURCE_TYPE_NAME() *string
- func CfnDBInstance_IsCfnElement(x interface{}) *bool
- func CfnDBInstance_IsCfnResource(construct constructs.IConstruct) *bool
- func CfnDBInstance_IsConstruct(x interface{}) *bool
- func CfnDBSubnetGroup_CFN_RESOURCE_TYPE_NAME() *string
- func CfnDBSubnetGroup_IsCfnElement(x interface{}) *bool
- func CfnDBSubnetGroup_IsCfnResource(construct constructs.IConstruct) *bool
- func CfnDBSubnetGroup_IsConstruct(x interface{}) *bool
- func ClusterParameterGroup_IsConstruct(x interface{}) *bool
- func ClusterParameterGroup_IsResource(construct constructs.IConstruct) *bool
- func DatabaseCluster_DEFAULT_NUM_INSTANCES() *float64
- func DatabaseCluster_DEFAULT_PORT() *float64
- func DatabaseCluster_IsConstruct(x interface{}) *bool
- func DatabaseCluster_IsResource(construct constructs.IConstruct) *bool
- func DatabaseInstance_IsConstruct(x interface{}) *bool
- func DatabaseInstance_IsResource(construct constructs.IConstruct) *bool
- func DatabaseSecret_FromSecretAttributes(scope constructs.Construct, id *string, ...) awssecretsmanager.ISecret
- func DatabaseSecret_FromSecretCompleteArn(scope constructs.Construct, id *string, secretCompleteArn *string) awssecretsmanager.ISecret
- func DatabaseSecret_FromSecretNameV2(scope constructs.Construct, id *string, secretName *string) awssecretsmanager.ISecret
- func DatabaseSecret_FromSecretPartialArn(scope constructs.Construct, id *string, secretPartialArn *string) awssecretsmanager.ISecret
- func DatabaseSecret_IsConstruct(x interface{}) *bool
- func DatabaseSecret_IsResource(construct constructs.IConstruct) *bool
- func NewCfnDBClusterParameterGroup_Override(c CfnDBClusterParameterGroup, scope constructs.Construct, id *string, ...)
- func NewCfnDBCluster_Override(c CfnDBCluster, scope constructs.Construct, id *string, ...)
- func NewCfnDBInstance_Override(c CfnDBInstance, scope constructs.Construct, id *string, ...)
- func NewCfnDBSubnetGroup_Override(c CfnDBSubnetGroup, scope constructs.Construct, id *string, ...)
- func NewClusterParameterGroup_Override(c ClusterParameterGroup, scope constructs.Construct, id *string, ...)
- func NewDatabaseCluster_Override(d DatabaseCluster, scope constructs.Construct, id *string, ...)
- func NewDatabaseInstance_Override(d DatabaseInstance, scope constructs.Construct, id *string, ...)
- func NewDatabaseSecret_Override(d DatabaseSecret, scope constructs.Construct, id *string, ...)
- func NewEndpoint_Override(e Endpoint, address *string, port *float64)
- type BackupProps
- type CfnDBCluster
- type CfnDBClusterParameterGroup
- type CfnDBClusterParameterGroupProps
- type CfnDBClusterProps
- type CfnDBInstance
- type CfnDBInstanceProps
- type CfnDBSubnetGroup
- type CfnDBSubnetGroupProps
- type ClusterParameterGroup
- type ClusterParameterGroupProps
- type DatabaseCluster
- type DatabaseClusterAttributes
- type DatabaseClusterProps
- type DatabaseInstance
- type DatabaseInstanceAttributes
- type DatabaseInstanceProps
- type DatabaseSecret
- type DatabaseSecretProps
- type Endpoint
- type IClusterParameterGroup
- type IDatabaseCluster
- type IDatabaseInstance
- type Login
- type RotationMultiUserOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CfnDBClusterParameterGroup_CFN_RESOURCE_TYPE_NAME ¶
func CfnDBClusterParameterGroup_CFN_RESOURCE_TYPE_NAME() *string
func CfnDBClusterParameterGroup_IsCfnElement ¶
func CfnDBClusterParameterGroup_IsCfnElement(x interface{}) *bool
Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.
Returns: The construct as a stack element or undefined if it is not a stack element.
func CfnDBClusterParameterGroup_IsCfnResource ¶
func CfnDBClusterParameterGroup_IsCfnResource(construct constructs.IConstruct) *bool
Check whether the given construct is a CfnResource.
func CfnDBClusterParameterGroup_IsConstruct ¶
func CfnDBClusterParameterGroup_IsConstruct(x interface{}) *bool
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 CfnDBCluster_CFN_RESOURCE_TYPE_NAME ¶
func CfnDBCluster_CFN_RESOURCE_TYPE_NAME() *string
func CfnDBCluster_IsCfnElement ¶
func CfnDBCluster_IsCfnElement(x interface{}) *bool
Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.
Returns: The construct as a stack element or undefined if it is not a stack element.
func CfnDBCluster_IsCfnResource ¶
func CfnDBCluster_IsCfnResource(construct constructs.IConstruct) *bool
Check whether the given construct is a CfnResource.
func CfnDBCluster_IsConstruct ¶
func CfnDBCluster_IsConstruct(x interface{}) *bool
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 CfnDBInstance_CFN_RESOURCE_TYPE_NAME ¶
func CfnDBInstance_CFN_RESOURCE_TYPE_NAME() *string
func CfnDBInstance_IsCfnElement ¶
func CfnDBInstance_IsCfnElement(x interface{}) *bool
Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.
Returns: The construct as a stack element or undefined if it is not a stack element.
func CfnDBInstance_IsCfnResource ¶
func CfnDBInstance_IsCfnResource(construct constructs.IConstruct) *bool
Check whether the given construct is a CfnResource.
func CfnDBInstance_IsConstruct ¶
func CfnDBInstance_IsConstruct(x interface{}) *bool
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 CfnDBSubnetGroup_CFN_RESOURCE_TYPE_NAME ¶
func CfnDBSubnetGroup_CFN_RESOURCE_TYPE_NAME() *string
func CfnDBSubnetGroup_IsCfnElement ¶
func CfnDBSubnetGroup_IsCfnElement(x interface{}) *bool
Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.
Returns: The construct as a stack element or undefined if it is not a stack element.
func CfnDBSubnetGroup_IsCfnResource ¶
func CfnDBSubnetGroup_IsCfnResource(construct constructs.IConstruct) *bool
Check whether the given construct is a CfnResource.
func CfnDBSubnetGroup_IsConstruct ¶
func CfnDBSubnetGroup_IsConstruct(x interface{}) *bool
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 ClusterParameterGroup_IsConstruct ¶
func ClusterParameterGroup_IsConstruct(x interface{}) *bool
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 ClusterParameterGroup_IsResource ¶
func ClusterParameterGroup_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource.
func DatabaseCluster_DEFAULT_NUM_INSTANCES ¶
func DatabaseCluster_DEFAULT_NUM_INSTANCES() *float64
func DatabaseCluster_DEFAULT_PORT ¶
func DatabaseCluster_DEFAULT_PORT() *float64
func DatabaseCluster_IsConstruct ¶
func DatabaseCluster_IsConstruct(x interface{}) *bool
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 DatabaseCluster_IsResource ¶
func DatabaseCluster_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource.
func DatabaseInstance_IsConstruct ¶
func DatabaseInstance_IsConstruct(x interface{}) *bool
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 DatabaseInstance_IsResource ¶
func DatabaseInstance_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource.
func DatabaseSecret_FromSecretAttributes ¶
func DatabaseSecret_FromSecretAttributes(scope constructs.Construct, id *string, attrs *awssecretsmanager.SecretAttributes) awssecretsmanager.ISecret
Import an existing secret into the Stack.
func DatabaseSecret_FromSecretCompleteArn ¶
func DatabaseSecret_FromSecretCompleteArn(scope constructs.Construct, id *string, secretCompleteArn *string) awssecretsmanager.ISecret
Imports a secret by complete ARN.
The complete ARN is the ARN with the Secrets Manager-supplied suffix.
func DatabaseSecret_FromSecretNameV2 ¶
func DatabaseSecret_FromSecretNameV2(scope constructs.Construct, id *string, secretName *string) awssecretsmanager.ISecret
Imports a secret by secret name.
A secret with this name must exist in the same account & region. Replaces the deprecated `fromSecretName`.
func DatabaseSecret_FromSecretPartialArn ¶
func DatabaseSecret_FromSecretPartialArn(scope constructs.Construct, id *string, secretPartialArn *string) awssecretsmanager.ISecret
Imports a secret by partial ARN.
The partial ARN is the ARN without the Secrets Manager-supplied suffix.
func DatabaseSecret_IsConstruct ¶
func DatabaseSecret_IsConstruct(x interface{}) *bool
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 DatabaseSecret_IsResource ¶
func DatabaseSecret_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource.
func NewCfnDBClusterParameterGroup_Override ¶
func NewCfnDBClusterParameterGroup_Override(c CfnDBClusterParameterGroup, scope constructs.Construct, id *string, props *CfnDBClusterParameterGroupProps)
Create a new `AWS::DocDB::DBClusterParameterGroup`.
func NewCfnDBCluster_Override ¶
func NewCfnDBCluster_Override(c CfnDBCluster, scope constructs.Construct, id *string, props *CfnDBClusterProps)
Create a new `AWS::DocDB::DBCluster`.
func NewCfnDBInstance_Override ¶
func NewCfnDBInstance_Override(c CfnDBInstance, scope constructs.Construct, id *string, props *CfnDBInstanceProps)
Create a new `AWS::DocDB::DBInstance`.
func NewCfnDBSubnetGroup_Override ¶
func NewCfnDBSubnetGroup_Override(c CfnDBSubnetGroup, scope constructs.Construct, id *string, props *CfnDBSubnetGroupProps)
Create a new `AWS::DocDB::DBSubnetGroup`.
func NewClusterParameterGroup_Override ¶
func NewClusterParameterGroup_Override(c ClusterParameterGroup, scope constructs.Construct, id *string, props *ClusterParameterGroupProps)
func NewDatabaseCluster_Override ¶
func NewDatabaseCluster_Override(d DatabaseCluster, scope constructs.Construct, id *string, props *DatabaseClusterProps)
func NewDatabaseInstance_Override ¶
func NewDatabaseInstance_Override(d DatabaseInstance, scope constructs.Construct, id *string, props *DatabaseInstanceProps)
func NewDatabaseSecret_Override ¶
func NewDatabaseSecret_Override(d DatabaseSecret, scope constructs.Construct, id *string, props *DatabaseSecretProps)
func NewEndpoint_Override ¶
Constructs an Endpoint instance.
Types ¶
type BackupProps ¶
type BackupProps struct { // How many days to retain the backup. Retention awscdk.Duration `json:"retention" yaml:"retention"` // A daily time range in 24-hours UTC format in which backups preferably execute. // // Must be at least 30 minutes long. // // Example: '01:00-02:00'. PreferredWindow *string `json:"preferredWindow" yaml:"preferredWindow"` }
Backup configuration for DocumentDB databases.
Example:
import cdk "github.com/aws/aws-cdk-go/awscdk"import awscdk "github.com/aws/aws-cdk-go/awscdk"import docdb "github.com/aws/aws-cdk-go/awscdk/aws_docdb" backupProps := &backupProps{ retention: cdk.duration.minutes(jsii.Number(30)), // the properties below are optional preferredWindow: jsii.String("preferredWindow"), }
type CfnDBCluster ¶
type CfnDBCluster interface { awscdk.CfnResource awscdk.IInspectable // The resource id for the cluster; // // for example: `cluster-ABCD1234EFGH5678IJKL90MNOP` . The cluster ID uniquely identifies the cluster and is used in things like IAM authentication policies. AttrClusterResourceId() *string // The connection endpoint for the cluster, such as `sample-cluster.cluster-cozrlsfrcjoc.us-east-1.docdb.amazonaws.com` . AttrEndpoint() *string // The port number on which the cluster accepts connections. // // For example: `27017` . AttrPort() *string // The reader endpoint for the cluster. // // For example: `sample-cluster.cluster-ro-cozrlsfrcjoc.us-east-1.docdb.amazonaws.com` . AttrReadEndpoint() *string // A list of Amazon EC2 Availability Zones that instances in the cluster can be created in. AvailabilityZones() *[]*string SetAvailabilityZones(val *[]*string) // The number of days for which automated backups are retained. You must specify a minimum value of 1. // // Default: 1 // // Constraints: // // - Must be a value from 1 to 35. BackupRetentionPeriod() *float64 SetBackupRetentionPeriod(val *float64) // Options for this resource, such as condition, update policy etc. CfnOptions() awscdk.ICfnResourceOptions CfnProperties() *map[string]interface{} // AWS resource type. CfnResourceType() *string // `AWS::DocDB::DBCluster.CopyTagsToSnapshot`. CopyTagsToSnapshot() interface{} SetCopyTagsToSnapshot(val interface{}) // Returns: the stack trace of the point where this Resource was created from, sourced // from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most // node +internal+ entries filtered. CreationStack() *[]*string // The cluster identifier. This parameter is stored as a lowercase string. // // Constraints: // // - Must contain from 1 to 63 letters, numbers, or hyphens. // - The first character must be a letter. // - Cannot end with a hyphen or contain two consecutive hyphens. // // Example: `my-cluster`. DbClusterIdentifier() *string SetDbClusterIdentifier(val *string) // The name of the cluster parameter group to associate with this cluster. DbClusterParameterGroupName() *string SetDbClusterParameterGroupName(val *string) // A subnet group to associate with this cluster. // // Constraints: Must match the name of an existing `DBSubnetGroup` . Must not be default. // // Example: `mySubnetgroup`. DbSubnetGroupName() *string SetDbSubnetGroupName(val *string) // Protects clusters from being accidentally deleted. // // If enabled, the cluster cannot be deleted unless it is modified and `DeletionProtection` is disabled. DeletionProtection() interface{} SetDeletionProtection(val interface{}) // The list of log types that need to be enabled for exporting to Amazon CloudWatch Logs. // // You can enable audit logs or profiler logs. For more information, see [Auditing Amazon DocumentDB Events](https://docs.aws.amazon.com/documentdb/latest/developerguide/event-auditing.html) and [Profiling Amazon DocumentDB Operations](https://docs.aws.amazon.com/documentdb/latest/developerguide/profiling.html) . EnableCloudwatchLogsExports() *[]*string SetEnableCloudwatchLogsExports(val *[]*string) // The version number of the database engine to use. // // The `--engine-version` will default to the latest major engine version. For production workloads, we recommend explicitly declaring this parameter with the intended major engine version. EngineVersion() *string SetEngineVersion(val *string) // The AWS KMS key identifier for an encrypted cluster. // // The AWS KMS key identifier is the Amazon Resource Name (ARN) for the AWS KMS encryption key. If you are creating a cluster using the same AWS account that owns the AWS KMS encryption key that is used to encrypt the new cluster, you can use the AWS KMS key alias instead of the ARN for the AWS KMS encryption key. // // If an encryption key is not specified in `KmsKeyId` : // // - If the `StorageEncrypted` parameter is `true` , Amazon DocumentDB uses your default encryption key. // // AWS KMS creates the default encryption key for your AWS account . Your AWS account has a different default encryption key for each AWS Regions . KmsKeyId() *string SetKmsKeyId(val *string) // The logical ID for this CloudFormation stack element. // // The logical ID of the element // is calculated from the path of the resource node in the construct tree. // // To override this value, use `overrideLogicalId(newLogicalId)`. // // Returns: the logical ID as a stringified token. This value will only get // resolved during synthesis. LogicalId() *string // The name of the master user for the cluster. // // Constraints: // // - Must be from 1 to 63 letters or numbers. // - The first character must be a letter. // - Cannot be a reserved word for the chosen database engine. MasterUsername() *string SetMasterUsername(val *string) // The password for the master database user. // // This password can contain any printable ASCII character except forward slash (/), double quote ("), or the "at" symbol (@). // // Constraints: Must contain from 8 to 100 characters. MasterUserPassword() *string SetMasterUserPassword(val *string) // The tree node. Node() constructs.Node // Specifies the port that the database engine is listening on. Port() *float64 SetPort(val *float64) // The daily time range during which automated backups are created if automated backups are enabled using the `BackupRetentionPeriod` parameter. // // The default is a 30-minute window selected at random from an 8-hour block of time for each AWS Region . // // Constraints: // // - Must be in the format `hh24:mi-hh24:mi` . // - Must be in Universal Coordinated Time (UTC). // - Must not conflict with the preferred maintenance window. // - Must be at least 30 minutes. PreferredBackupWindow() *string SetPreferredBackupWindow(val *string) // The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC). // // Format: `ddd:hh24:mi-ddd:hh24:mi` // // The default is a 30-minute window selected at random from an 8-hour block of time for each AWS Region , occurring on a random day of the week. // // Valid days: Mon, Tue, Wed, Thu, Fri, Sat, Sun // // Constraints: Minimum 30-minute window. PreferredMaintenanceWindow() *string SetPreferredMaintenanceWindow(val *string) // Return a string that will be resolved to a CloudFormation `{ Ref }` for this element. // // If, by any chance, the intrinsic reference of a resource is not a string, you could // coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`. Ref() *string // The identifier for the snapshot or cluster snapshot to restore from. // // You can use either the name or the Amazon Resource Name (ARN) to specify a cluster snapshot. However, you can use only the ARN to specify a snapshot. // // Constraints: // // - Must match the identifier of an existing snapshot. SnapshotIdentifier() *string SetSnapshotIdentifier(val *string) // The stack in which this element is defined. // // CfnElements must be defined within a stack scope (directly or indirectly). Stack() awscdk.Stack // Specifies whether the cluster is encrypted. StorageEncrypted() interface{} SetStorageEncrypted(val interface{}) // The tags to be assigned to the cluster. Tags() awscdk.TagManager // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperites() *map[string]interface{} // A list of EC2 VPC security groups to associate with this cluster. VpcSecurityGroupIds() *[]*string SetVpcSecurityGroupIds(val *[]*string) // Syntactic sugar for `addOverride(path, undefined)`. AddDeletionOverride(path *string) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // // This can be used for resources across stacks (or nested stack) boundaries // and the dependency will automatically be transferred to the relevant scope. AddDependsOn(target awscdk.CfnResource) // Add a value to the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // AddMetadata(key *string, value interface{}) // Adds an override to the synthesized CloudFormation resource. // // To add a // property override, either use `addPropertyOverride` or prefix `path` with // "Properties." (i.e. `Properties.TopicName`). // // If the override is nested, separate each nested level using a dot (.) in the path parameter. // If there is an array as part of the nesting, specify the index in the path. // // To include a literal `.` in the property name, prefix with a `\`. In most // programming languages you will need to write this as `"\\."` because the // `\` itself will need to be escaped. // // For example, // “`typescript // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']); // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE'); // “` // would add the overrides // “`json // "Properties": { // "GlobalSecondaryIndexes": [ // { // "Projection": { // "NonKeyAttributes": [ "myattribute" ] // ... // } // ... // }, // { // "ProjectionType": "INCLUDE" // ... // }, // ] // ... // } // “` // // The `value` argument to `addOverride` will not be processed or translated // in any way. Pass raw JSON values in here with the correct capitalization // for CloudFormation. If you pass CDK classes or structs, they will be // rendered with lowercased key names, and CloudFormation will reject the // template. AddOverride(path *string, value interface{}) // Adds an override that deletes the value of a property from the resource definition. AddPropertyDeletionOverride(propertyPath *string) // Adds an override to a resource property. // // Syntactic sugar for `addOverride("Properties.<...>", value)`. AddPropertyOverride(propertyPath *string, value interface{}) // Sets the deletion policy of the resource based on the removal policy specified. // // 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`). ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions) // Returns a token for an runtime attribute of this resource. // // Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility // in case there is no generated attribute. GetAtt(attributeName *string) awscdk.Reference // Retrieve a value value from the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // GetMetadata(key *string) interface{} // Examines the CloudFormation resource and discloses attributes. Inspect(inspector awscdk.TreeInspector) // Overrides the auto-generated logical ID with a specific ID. OverrideLogicalId(newLogicalId *string) RenderProperties(props *map[string]interface{}) *map[string]interface{} // Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template. // // Returns: `true` if the resource should be included or `false` is the resource // should be omitted. ShouldSynthesize() *bool // Returns a string representation of this construct. // // Returns: a string representation of this resource. ToString() *string ValidateProperties(_properties interface{}) }
A CloudFormation `AWS::DocDB::DBCluster`.
The `AWS::DocDB::DBCluster` Amazon DocumentDB (with MongoDB compatibility) resource describes a DBCluster. Amazon DocumentDB is a fully managed, MongoDB-compatible document database engine. For more information, see [DBCluster](https://docs.aws.amazon.com/documentdb/latest/developerguide/API_DBCluster.html) in the *Amazon DocumentDB Developer Guide* .
Example:
import awscdk "github.com/aws/aws-cdk-go/awscdk"import docdb "github.com/aws/aws-cdk-go/awscdk/aws_docdb" cfnDBCluster := docdb.NewCfnDBCluster(this, jsii.String("MyCfnDBCluster"), &cfnDBClusterProps{ availabilityZones: []*string{ jsii.String("availabilityZones"), }, backupRetentionPeriod: jsii.Number(123), copyTagsToSnapshot: jsii.Boolean(false), dbClusterIdentifier: jsii.String("dbClusterIdentifier"), dbClusterParameterGroupName: jsii.String("dbClusterParameterGroupName"), dbSubnetGroupName: jsii.String("dbSubnetGroupName"), deletionProtection: jsii.Boolean(false), enableCloudwatchLogsExports: []*string{ jsii.String("enableCloudwatchLogsExports"), }, engineVersion: jsii.String("engineVersion"), kmsKeyId: jsii.String("kmsKeyId"), masterUsername: jsii.String("masterUsername"), masterUserPassword: jsii.String("masterUserPassword"), port: jsii.Number(123), preferredBackupWindow: jsii.String("preferredBackupWindow"), preferredMaintenanceWindow: jsii.String("preferredMaintenanceWindow"), snapshotIdentifier: jsii.String("snapshotIdentifier"), storageEncrypted: jsii.Boolean(false), tags: []cfnTag{ &cfnTag{ key: jsii.String("key"), value: jsii.String("value"), }, }, vpcSecurityGroupIds: []*string{ jsii.String("vpcSecurityGroupIds"), }, })
func NewCfnDBCluster ¶
func NewCfnDBCluster(scope constructs.Construct, id *string, props *CfnDBClusterProps) CfnDBCluster
Create a new `AWS::DocDB::DBCluster`.
type CfnDBClusterParameterGroup ¶
type CfnDBClusterParameterGroup interface { awscdk.CfnResource awscdk.IInspectable // Options for this resource, such as condition, update policy etc. CfnOptions() awscdk.ICfnResourceOptions CfnProperties() *map[string]interface{} // AWS resource type. CfnResourceType() *string // Returns: the stack trace of the point where this Resource was created from, sourced // from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most // node +internal+ entries filtered. CreationStack() *[]*string // The description for the cluster parameter group. Description() *string SetDescription(val *string) // The cluster parameter group family name. Family() *string SetFamily(val *string) // The logical ID for this CloudFormation stack element. // // The logical ID of the element // is calculated from the path of the resource node in the construct tree. // // To override this value, use `overrideLogicalId(newLogicalId)`. // // Returns: the logical ID as a stringified token. This value will only get // resolved during synthesis. LogicalId() *string // The name of the DB cluster parameter group. // // Constraints: // // - Must not match the name of an existing `DBClusterParameterGroup` . // // > This value is stored as a lowercase string. Name() *string SetName(val *string) // The tree node. Node() constructs.Node // Provides a list of parameters for the cluster parameter group. Parameters() interface{} SetParameters(val interface{}) // Return a string that will be resolved to a CloudFormation `{ Ref }` for this element. // // If, by any chance, the intrinsic reference of a resource is not a string, you could // coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`. Ref() *string // The stack in which this element is defined. // // CfnElements must be defined within a stack scope (directly or indirectly). Stack() awscdk.Stack // The tags to be assigned to the cluster parameter group. Tags() awscdk.TagManager // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperites() *map[string]interface{} // Syntactic sugar for `addOverride(path, undefined)`. AddDeletionOverride(path *string) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // // This can be used for resources across stacks (or nested stack) boundaries // and the dependency will automatically be transferred to the relevant scope. AddDependsOn(target awscdk.CfnResource) // Add a value to the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // AddMetadata(key *string, value interface{}) // Adds an override to the synthesized CloudFormation resource. // // To add a // property override, either use `addPropertyOverride` or prefix `path` with // "Properties." (i.e. `Properties.TopicName`). // // If the override is nested, separate each nested level using a dot (.) in the path parameter. // If there is an array as part of the nesting, specify the index in the path. // // To include a literal `.` in the property name, prefix with a `\`. In most // programming languages you will need to write this as `"\\."` because the // `\` itself will need to be escaped. // // For example, // “`typescript // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']); // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE'); // “` // would add the overrides // “`json // "Properties": { // "GlobalSecondaryIndexes": [ // { // "Projection": { // "NonKeyAttributes": [ "myattribute" ] // ... // } // ... // }, // { // "ProjectionType": "INCLUDE" // ... // }, // ] // ... // } // “` // // The `value` argument to `addOverride` will not be processed or translated // in any way. Pass raw JSON values in here with the correct capitalization // for CloudFormation. If you pass CDK classes or structs, they will be // rendered with lowercased key names, and CloudFormation will reject the // template. AddOverride(path *string, value interface{}) // Adds an override that deletes the value of a property from the resource definition. AddPropertyDeletionOverride(propertyPath *string) // Adds an override to a resource property. // // Syntactic sugar for `addOverride("Properties.<...>", value)`. AddPropertyOverride(propertyPath *string, value interface{}) // Sets the deletion policy of the resource based on the removal policy specified. // // 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`). ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions) // Returns a token for an runtime attribute of this resource. // // Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility // in case there is no generated attribute. GetAtt(attributeName *string) awscdk.Reference // Retrieve a value value from the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // GetMetadata(key *string) interface{} // Examines the CloudFormation resource and discloses attributes. Inspect(inspector awscdk.TreeInspector) // Overrides the auto-generated logical ID with a specific ID. OverrideLogicalId(newLogicalId *string) RenderProperties(props *map[string]interface{}) *map[string]interface{} // Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template. // // Returns: `true` if the resource should be included or `false` is the resource // should be omitted. ShouldSynthesize() *bool // Returns a string representation of this construct. // // Returns: a string representation of this resource. ToString() *string ValidateProperties(_properties interface{}) }
A CloudFormation `AWS::DocDB::DBClusterParameterGroup`.
The `AWS::DocDB::DBClusterParameterGroup` Amazon DocumentDB (with MongoDB compatibility) resource describes a DBClusterParameterGroup. For more information, see [DBClusterParameterGroup](https://docs.aws.amazon.com/documentdb/latest/developerguide/API_DBClusterParameterGroup.html) in the *Amazon DocumentDB Developer Guide* .
Parameters in a cluster parameter group apply to all of the instances in a cluster.
A cluster parameter group is initially created with the default parameters for the database engine used by instances in the cluster. To provide custom values for any of the parameters, you must modify the group after you create it. After you create a DB cluster parameter group, you must associate it with your cluster. For the new cluster parameter group and associated settings to take effect, you must then reboot the DB instances in the cluster without failover.
> After you create a cluster parameter group, you should wait at least 5 minutes before creating your first cluster that uses that cluster parameter group as the default parameter group. This allows Amazon DocumentDB to fully complete the create action before the cluster parameter group is used as the default for a new cluster. This step is especially important for parameters that are critical when creating the default database for a cluster, such as the character set for the default database defined by the `character_set_database` parameter.
Example:
import awscdk "github.com/aws/aws-cdk-go/awscdk"import docdb "github.com/aws/aws-cdk-go/awscdk/aws_docdb" var parameters interface{} cfnDBClusterParameterGroup := docdb.NewCfnDBClusterParameterGroup(this, jsii.String("MyCfnDBClusterParameterGroup"), &cfnDBClusterParameterGroupProps{ description: jsii.String("description"), family: jsii.String("family"), parameters: parameters, // the properties below are optional name: jsii.String("name"), tags: []cfnTag{ &cfnTag{ key: jsii.String("key"), value: jsii.String("value"), }, }, })
func NewCfnDBClusterParameterGroup ¶
func NewCfnDBClusterParameterGroup(scope constructs.Construct, id *string, props *CfnDBClusterParameterGroupProps) CfnDBClusterParameterGroup
Create a new `AWS::DocDB::DBClusterParameterGroup`.
type CfnDBClusterParameterGroupProps ¶
type CfnDBClusterParameterGroupProps struct { // The description for the cluster parameter group. Description *string `json:"description" yaml:"description"` // The cluster parameter group family name. Family *string `json:"family" yaml:"family"` // Provides a list of parameters for the cluster parameter group. Parameters interface{} `json:"parameters" yaml:"parameters"` // The name of the DB cluster parameter group. // // Constraints: // // - Must not match the name of an existing `DBClusterParameterGroup` . // // > This value is stored as a lowercase string. Name *string `json:"name" yaml:"name"` // The tags to be assigned to the cluster parameter group. Tags *[]*awscdk.CfnTag `json:"tags" yaml:"tags"` }
Properties for defining a `CfnDBClusterParameterGroup`.
Example:
import awscdk "github.com/aws/aws-cdk-go/awscdk"import docdb "github.com/aws/aws-cdk-go/awscdk/aws_docdb" var parameters interface{} cfnDBClusterParameterGroupProps := &cfnDBClusterParameterGroupProps{ description: jsii.String("description"), family: jsii.String("family"), parameters: parameters, // the properties below are optional name: jsii.String("name"), tags: []cfnTag{ &cfnTag{ key: jsii.String("key"), value: jsii.String("value"), }, }, }
type CfnDBClusterProps ¶
type CfnDBClusterProps struct { // A list of Amazon EC2 Availability Zones that instances in the cluster can be created in. AvailabilityZones *[]*string `json:"availabilityZones" yaml:"availabilityZones"` // The number of days for which automated backups are retained. You must specify a minimum value of 1. // // Default: 1 // // Constraints: // // - Must be a value from 1 to 35. BackupRetentionPeriod *float64 `json:"backupRetentionPeriod" yaml:"backupRetentionPeriod"` // `AWS::DocDB::DBCluster.CopyTagsToSnapshot`. CopyTagsToSnapshot interface{} `json:"copyTagsToSnapshot" yaml:"copyTagsToSnapshot"` // The cluster identifier. This parameter is stored as a lowercase string. // // Constraints: // // - Must contain from 1 to 63 letters, numbers, or hyphens. // - The first character must be a letter. // - Cannot end with a hyphen or contain two consecutive hyphens. // // Example: `my-cluster`. DbClusterIdentifier *string `json:"dbClusterIdentifier" yaml:"dbClusterIdentifier"` // The name of the cluster parameter group to associate with this cluster. DbClusterParameterGroupName *string `json:"dbClusterParameterGroupName" yaml:"dbClusterParameterGroupName"` // A subnet group to associate with this cluster. // // Constraints: Must match the name of an existing `DBSubnetGroup` . Must not be default. // // Example: `mySubnetgroup`. DbSubnetGroupName *string `json:"dbSubnetGroupName" yaml:"dbSubnetGroupName"` // Protects clusters from being accidentally deleted. // // If enabled, the cluster cannot be deleted unless it is modified and `DeletionProtection` is disabled. DeletionProtection interface{} `json:"deletionProtection" yaml:"deletionProtection"` // The list of log types that need to be enabled for exporting to Amazon CloudWatch Logs. // // You can enable audit logs or profiler logs. For more information, see [Auditing Amazon DocumentDB Events](https://docs.aws.amazon.com/documentdb/latest/developerguide/event-auditing.html) and [Profiling Amazon DocumentDB Operations](https://docs.aws.amazon.com/documentdb/latest/developerguide/profiling.html) . EnableCloudwatchLogsExports *[]*string `json:"enableCloudwatchLogsExports" yaml:"enableCloudwatchLogsExports"` // The version number of the database engine to use. // // The `--engine-version` will default to the latest major engine version. For production workloads, we recommend explicitly declaring this parameter with the intended major engine version. EngineVersion *string `json:"engineVersion" yaml:"engineVersion"` // The AWS KMS key identifier for an encrypted cluster. // // The AWS KMS key identifier is the Amazon Resource Name (ARN) for the AWS KMS encryption key. If you are creating a cluster using the same AWS account that owns the AWS KMS encryption key that is used to encrypt the new cluster, you can use the AWS KMS key alias instead of the ARN for the AWS KMS encryption key. // // If an encryption key is not specified in `KmsKeyId` : // // - If the `StorageEncrypted` parameter is `true` , Amazon DocumentDB uses your default encryption key. // // AWS KMS creates the default encryption key for your AWS account . Your AWS account has a different default encryption key for each AWS Regions . KmsKeyId *string `json:"kmsKeyId" yaml:"kmsKeyId"` // The name of the master user for the cluster. // // Constraints: // // - Must be from 1 to 63 letters or numbers. // - The first character must be a letter. // - Cannot be a reserved word for the chosen database engine. MasterUsername *string `json:"masterUsername" yaml:"masterUsername"` // The password for the master database user. // // This password can contain any printable ASCII character except forward slash (/), double quote ("), or the "at" symbol (@). // // Constraints: Must contain from 8 to 100 characters. MasterUserPassword *string `json:"masterUserPassword" yaml:"masterUserPassword"` // Specifies the port that the database engine is listening on. Port *float64 `json:"port" yaml:"port"` // The daily time range during which automated backups are created if automated backups are enabled using the `BackupRetentionPeriod` parameter. // // The default is a 30-minute window selected at random from an 8-hour block of time for each AWS Region . // // Constraints: // // - Must be in the format `hh24:mi-hh24:mi` . // - Must be in Universal Coordinated Time (UTC). // - Must not conflict with the preferred maintenance window. // - Must be at least 30 minutes. PreferredBackupWindow *string `json:"preferredBackupWindow" yaml:"preferredBackupWindow"` // The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC). // // Format: `ddd:hh24:mi-ddd:hh24:mi` // // The default is a 30-minute window selected at random from an 8-hour block of time for each AWS Region , occurring on a random day of the week. // // Valid days: Mon, Tue, Wed, Thu, Fri, Sat, Sun // // Constraints: Minimum 30-minute window. PreferredMaintenanceWindow *string `json:"preferredMaintenanceWindow" yaml:"preferredMaintenanceWindow"` // The identifier for the snapshot or cluster snapshot to restore from. // // You can use either the name or the Amazon Resource Name (ARN) to specify a cluster snapshot. However, you can use only the ARN to specify a snapshot. // // Constraints: // // - Must match the identifier of an existing snapshot. SnapshotIdentifier *string `json:"snapshotIdentifier" yaml:"snapshotIdentifier"` // Specifies whether the cluster is encrypted. StorageEncrypted interface{} `json:"storageEncrypted" yaml:"storageEncrypted"` // The tags to be assigned to the cluster. Tags *[]*awscdk.CfnTag `json:"tags" yaml:"tags"` // A list of EC2 VPC security groups to associate with this cluster. VpcSecurityGroupIds *[]*string `json:"vpcSecurityGroupIds" yaml:"vpcSecurityGroupIds"` }
Properties for defining a `CfnDBCluster`.
Example:
import awscdk "github.com/aws/aws-cdk-go/awscdk"import docdb "github.com/aws/aws-cdk-go/awscdk/aws_docdb" cfnDBClusterProps := &cfnDBClusterProps{ availabilityZones: []*string{ jsii.String("availabilityZones"), }, backupRetentionPeriod: jsii.Number(123), copyTagsToSnapshot: jsii.Boolean(false), dbClusterIdentifier: jsii.String("dbClusterIdentifier"), dbClusterParameterGroupName: jsii.String("dbClusterParameterGroupName"), dbSubnetGroupName: jsii.String("dbSubnetGroupName"), deletionProtection: jsii.Boolean(false), enableCloudwatchLogsExports: []*string{ jsii.String("enableCloudwatchLogsExports"), }, engineVersion: jsii.String("engineVersion"), kmsKeyId: jsii.String("kmsKeyId"), masterUsername: jsii.String("masterUsername"), masterUserPassword: jsii.String("masterUserPassword"), port: jsii.Number(123), preferredBackupWindow: jsii.String("preferredBackupWindow"), preferredMaintenanceWindow: jsii.String("preferredMaintenanceWindow"), snapshotIdentifier: jsii.String("snapshotIdentifier"), storageEncrypted: jsii.Boolean(false), tags: []cfnTag{ &cfnTag{ key: jsii.String("key"), value: jsii.String("value"), }, }, vpcSecurityGroupIds: []*string{ jsii.String("vpcSecurityGroupIds"), }, }
type CfnDBInstance ¶
type CfnDBInstance interface { awscdk.CfnResource awscdk.IInspectable // The connection endpoint for the instance. // // For example: `sample-cluster.cluster-abcdefghijkl.us-east-1.docdb.amazonaws.com` . AttrEndpoint() *string // The port number on which the database accepts connections, such as `27017` . AttrPort() *string // This parameter does not apply to Amazon DocumentDB. // // Amazon DocumentDB does not perform minor version upgrades regardless of the value set. // // Default: `false`. AutoMinorVersionUpgrade() interface{} SetAutoMinorVersionUpgrade(val interface{}) // The Amazon EC2 Availability Zone that the instance is created in. // // Default: A random, system-chosen Availability Zone in the endpoint's AWS Region . // // Example: `us-east-1d`. AvailabilityZone() *string SetAvailabilityZone(val *string) // Options for this resource, such as condition, update policy etc. CfnOptions() awscdk.ICfnResourceOptions CfnProperties() *map[string]interface{} // AWS resource type. CfnResourceType() *string // Returns: the stack trace of the point where this Resource was created from, sourced // from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most // node +internal+ entries filtered. CreationStack() *[]*string // The identifier of the cluster that the instance will belong to. DbClusterIdentifier() *string SetDbClusterIdentifier(val *string) // The compute and memory capacity of the instance; // // for example, `db.m4.large` . If you change the class of an instance there can be some interruption in the cluster's service. DbInstanceClass() *string SetDbInstanceClass(val *string) // The instance identifier. This parameter is stored as a lowercase string. // // Constraints: // // - Must contain from 1 to 63 letters, numbers, or hyphens. // - The first character must be a letter. // - Cannot end with a hyphen or contain two consecutive hyphens. // // Example: `mydbinstance`. DbInstanceIdentifier() *string SetDbInstanceIdentifier(val *string) // `AWS::DocDB::DBInstance.EnablePerformanceInsights`. EnablePerformanceInsights() interface{} SetEnablePerformanceInsights(val interface{}) // The logical ID for this CloudFormation stack element. // // The logical ID of the element // is calculated from the path of the resource node in the construct tree. // // To override this value, use `overrideLogicalId(newLogicalId)`. // // Returns: the logical ID as a stringified token. This value will only get // resolved during synthesis. LogicalId() *string // The tree node. Node() constructs.Node // The time range each week during which system maintenance can occur, in Universal Coordinated Time (UTC). // // Format: `ddd:hh24:mi-ddd:hh24:mi` // // The default is a 30-minute window selected at random from an 8-hour block of time for each AWS Region , occurring on a random day of the week. // // Valid days: Mon, Tue, Wed, Thu, Fri, Sat, Sun // // Constraints: Minimum 30-minute window. PreferredMaintenanceWindow() *string SetPreferredMaintenanceWindow(val *string) // Return a string that will be resolved to a CloudFormation `{ Ref }` for this element. // // If, by any chance, the intrinsic reference of a resource is not a string, you could // coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`. Ref() *string // The stack in which this element is defined. // // CfnElements must be defined within a stack scope (directly or indirectly). Stack() awscdk.Stack // The tags to be assigned to the instance. // // You can assign up to 10 tags to an instance. Tags() awscdk.TagManager // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperites() *map[string]interface{} // Syntactic sugar for `addOverride(path, undefined)`. AddDeletionOverride(path *string) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // // This can be used for resources across stacks (or nested stack) boundaries // and the dependency will automatically be transferred to the relevant scope. AddDependsOn(target awscdk.CfnResource) // Add a value to the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // AddMetadata(key *string, value interface{}) // Adds an override to the synthesized CloudFormation resource. // // To add a // property override, either use `addPropertyOverride` or prefix `path` with // "Properties." (i.e. `Properties.TopicName`). // // If the override is nested, separate each nested level using a dot (.) in the path parameter. // If there is an array as part of the nesting, specify the index in the path. // // To include a literal `.` in the property name, prefix with a `\`. In most // programming languages you will need to write this as `"\\."` because the // `\` itself will need to be escaped. // // For example, // “`typescript // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']); // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE'); // “` // would add the overrides // “`json // "Properties": { // "GlobalSecondaryIndexes": [ // { // "Projection": { // "NonKeyAttributes": [ "myattribute" ] // ... // } // ... // }, // { // "ProjectionType": "INCLUDE" // ... // }, // ] // ... // } // “` // // The `value` argument to `addOverride` will not be processed or translated // in any way. Pass raw JSON values in here with the correct capitalization // for CloudFormation. If you pass CDK classes or structs, they will be // rendered with lowercased key names, and CloudFormation will reject the // template. AddOverride(path *string, value interface{}) // Adds an override that deletes the value of a property from the resource definition. AddPropertyDeletionOverride(propertyPath *string) // Adds an override to a resource property. // // Syntactic sugar for `addOverride("Properties.<...>", value)`. AddPropertyOverride(propertyPath *string, value interface{}) // Sets the deletion policy of the resource based on the removal policy specified. // // 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`). ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions) // Returns a token for an runtime attribute of this resource. // // Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility // in case there is no generated attribute. GetAtt(attributeName *string) awscdk.Reference // Retrieve a value value from the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // GetMetadata(key *string) interface{} // Examines the CloudFormation resource and discloses attributes. Inspect(inspector awscdk.TreeInspector) // Overrides the auto-generated logical ID with a specific ID. OverrideLogicalId(newLogicalId *string) RenderProperties(props *map[string]interface{}) *map[string]interface{} // Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template. // // Returns: `true` if the resource should be included or `false` is the resource // should be omitted. ShouldSynthesize() *bool // Returns a string representation of this construct. // // Returns: a string representation of this resource. ToString() *string ValidateProperties(_properties interface{}) }
A CloudFormation `AWS::DocDB::DBInstance`.
The `AWS::DocDB::DBInstance` Amazon DocumentDB (with MongoDB compatibility) resource describes a DBInstance. For more information, see [DBInstance](https://docs.aws.amazon.com/documentdb/latest/developerguide/API_DBInstance.html) in the *Amazon DocumentDB Developer Guide* .
Example:
import awscdk "github.com/aws/aws-cdk-go/awscdk"import docdb "github.com/aws/aws-cdk-go/awscdk/aws_docdb" cfnDBInstance := docdb.NewCfnDBInstance(this, jsii.String("MyCfnDBInstance"), &cfnDBInstanceProps{ dbClusterIdentifier: jsii.String("dbClusterIdentifier"), dbInstanceClass: jsii.String("dbInstanceClass"), // the properties below are optional autoMinorVersionUpgrade: jsii.Boolean(false), availabilityZone: jsii.String("availabilityZone"), dbInstanceIdentifier: jsii.String("dbInstanceIdentifier"), enablePerformanceInsights: jsii.Boolean(false), preferredMaintenanceWindow: jsii.String("preferredMaintenanceWindow"), tags: []cfnTag{ &cfnTag{ key: jsii.String("key"), value: jsii.String("value"), }, }, })
func NewCfnDBInstance ¶
func NewCfnDBInstance(scope constructs.Construct, id *string, props *CfnDBInstanceProps) CfnDBInstance
Create a new `AWS::DocDB::DBInstance`.
type CfnDBInstanceProps ¶
type CfnDBInstanceProps struct { // The identifier of the cluster that the instance will belong to. DbClusterIdentifier *string `json:"dbClusterIdentifier" yaml:"dbClusterIdentifier"` // The compute and memory capacity of the instance; // // for example, `db.m4.large` . If you change the class of an instance there can be some interruption in the cluster's service. DbInstanceClass *string `json:"dbInstanceClass" yaml:"dbInstanceClass"` // This parameter does not apply to Amazon DocumentDB. // // Amazon DocumentDB does not perform minor version upgrades regardless of the value set. // // Default: `false`. AutoMinorVersionUpgrade interface{} `json:"autoMinorVersionUpgrade" yaml:"autoMinorVersionUpgrade"` // The Amazon EC2 Availability Zone that the instance is created in. // // Default: A random, system-chosen Availability Zone in the endpoint's AWS Region . // // Example: `us-east-1d`. AvailabilityZone *string `json:"availabilityZone" yaml:"availabilityZone"` // The instance identifier. This parameter is stored as a lowercase string. // // Constraints: // // - Must contain from 1 to 63 letters, numbers, or hyphens. // - The first character must be a letter. // - Cannot end with a hyphen or contain two consecutive hyphens. // // Example: `mydbinstance`. DbInstanceIdentifier *string `json:"dbInstanceIdentifier" yaml:"dbInstanceIdentifier"` // `AWS::DocDB::DBInstance.EnablePerformanceInsights`. EnablePerformanceInsights interface{} `json:"enablePerformanceInsights" yaml:"enablePerformanceInsights"` // The time range each week during which system maintenance can occur, in Universal Coordinated Time (UTC). // // Format: `ddd:hh24:mi-ddd:hh24:mi` // // The default is a 30-minute window selected at random from an 8-hour block of time for each AWS Region , occurring on a random day of the week. // // Valid days: Mon, Tue, Wed, Thu, Fri, Sat, Sun // // Constraints: Minimum 30-minute window. PreferredMaintenanceWindow *string `json:"preferredMaintenanceWindow" yaml:"preferredMaintenanceWindow"` // The tags to be assigned to the instance. // // You can assign up to 10 tags to an instance. Tags *[]*awscdk.CfnTag `json:"tags" yaml:"tags"` }
Properties for defining a `CfnDBInstance`.
Example:
import awscdk "github.com/aws/aws-cdk-go/awscdk"import docdb "github.com/aws/aws-cdk-go/awscdk/aws_docdb" cfnDBInstanceProps := &cfnDBInstanceProps{ dbClusterIdentifier: jsii.String("dbClusterIdentifier"), dbInstanceClass: jsii.String("dbInstanceClass"), // the properties below are optional autoMinorVersionUpgrade: jsii.Boolean(false), availabilityZone: jsii.String("availabilityZone"), dbInstanceIdentifier: jsii.String("dbInstanceIdentifier"), enablePerformanceInsights: jsii.Boolean(false), preferredMaintenanceWindow: jsii.String("preferredMaintenanceWindow"), tags: []cfnTag{ &cfnTag{ key: jsii.String("key"), value: jsii.String("value"), }, }, }
type CfnDBSubnetGroup ¶
type CfnDBSubnetGroup interface { awscdk.CfnResource awscdk.IInspectable // Options for this resource, such as condition, update policy etc. CfnOptions() awscdk.ICfnResourceOptions CfnProperties() *map[string]interface{} // AWS resource type. CfnResourceType() *string // Returns: the stack trace of the point where this Resource was created from, sourced // from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most // node +internal+ entries filtered. CreationStack() *[]*string // The description for the subnet group. DbSubnetGroupDescription() *string SetDbSubnetGroupDescription(val *string) // The name for the subnet group. This value is stored as a lowercase string. // // Constraints: Must contain no more than 255 letters, numbers, periods, underscores, spaces, or hyphens. Must not be default. // // Example: `mySubnetgroup`. DbSubnetGroupName() *string SetDbSubnetGroupName(val *string) // The logical ID for this CloudFormation stack element. // // The logical ID of the element // is calculated from the path of the resource node in the construct tree. // // To override this value, use `overrideLogicalId(newLogicalId)`. // // Returns: the logical ID as a stringified token. This value will only get // resolved during synthesis. LogicalId() *string // The tree node. Node() constructs.Node // Return a string that will be resolved to a CloudFormation `{ Ref }` for this element. // // If, by any chance, the intrinsic reference of a resource is not a string, you could // coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`. Ref() *string // The stack in which this element is defined. // // CfnElements must be defined within a stack scope (directly or indirectly). Stack() awscdk.Stack // The Amazon EC2 subnet IDs for the subnet group. SubnetIds() *[]*string SetSubnetIds(val *[]*string) // The tags to be assigned to the subnet group. Tags() awscdk.TagManager // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperites() *map[string]interface{} // Syntactic sugar for `addOverride(path, undefined)`. AddDeletionOverride(path *string) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // // This can be used for resources across stacks (or nested stack) boundaries // and the dependency will automatically be transferred to the relevant scope. AddDependsOn(target awscdk.CfnResource) // Add a value to the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // AddMetadata(key *string, value interface{}) // Adds an override to the synthesized CloudFormation resource. // // To add a // property override, either use `addPropertyOverride` or prefix `path` with // "Properties." (i.e. `Properties.TopicName`). // // If the override is nested, separate each nested level using a dot (.) in the path parameter. // If there is an array as part of the nesting, specify the index in the path. // // To include a literal `.` in the property name, prefix with a `\`. In most // programming languages you will need to write this as `"\\."` because the // `\` itself will need to be escaped. // // For example, // “`typescript // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']); // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE'); // “` // would add the overrides // “`json // "Properties": { // "GlobalSecondaryIndexes": [ // { // "Projection": { // "NonKeyAttributes": [ "myattribute" ] // ... // } // ... // }, // { // "ProjectionType": "INCLUDE" // ... // }, // ] // ... // } // “` // // The `value` argument to `addOverride` will not be processed or translated // in any way. Pass raw JSON values in here with the correct capitalization // for CloudFormation. If you pass CDK classes or structs, they will be // rendered with lowercased key names, and CloudFormation will reject the // template. AddOverride(path *string, value interface{}) // Adds an override that deletes the value of a property from the resource definition. AddPropertyDeletionOverride(propertyPath *string) // Adds an override to a resource property. // // Syntactic sugar for `addOverride("Properties.<...>", value)`. AddPropertyOverride(propertyPath *string, value interface{}) // Sets the deletion policy of the resource based on the removal policy specified. // // 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`). ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions) // Returns a token for an runtime attribute of this resource. // // Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility // in case there is no generated attribute. GetAtt(attributeName *string) awscdk.Reference // Retrieve a value value from the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // GetMetadata(key *string) interface{} // Examines the CloudFormation resource and discloses attributes. Inspect(inspector awscdk.TreeInspector) // Overrides the auto-generated logical ID with a specific ID. OverrideLogicalId(newLogicalId *string) RenderProperties(props *map[string]interface{}) *map[string]interface{} // Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template. // // Returns: `true` if the resource should be included or `false` is the resource // should be omitted. ShouldSynthesize() *bool // Returns a string representation of this construct. // // Returns: a string representation of this resource. ToString() *string ValidateProperties(_properties interface{}) }
A CloudFormation `AWS::DocDB::DBSubnetGroup`.
The `AWS::DocDB::DBSubnetGroup` Amazon DocumentDB (with MongoDB compatibility) resource describes a DBSubnetGroup. subnet groups must contain at least one subnet in at least two Availability Zones in the AWS Region . For more information, see [DBSubnetGroup](https://docs.aws.amazon.com/documentdb/latest/developerguide/API_DBSubnetGroup.html) in the *Amazon DocumentDB Developer Guide* .
Example:
import awscdk "github.com/aws/aws-cdk-go/awscdk"import docdb "github.com/aws/aws-cdk-go/awscdk/aws_docdb" cfnDBSubnetGroup := docdb.NewCfnDBSubnetGroup(this, jsii.String("MyCfnDBSubnetGroup"), &cfnDBSubnetGroupProps{ dbSubnetGroupDescription: jsii.String("dbSubnetGroupDescription"), subnetIds: []*string{ jsii.String("subnetIds"), }, // the properties below are optional dbSubnetGroupName: jsii.String("dbSubnetGroupName"), tags: []cfnTag{ &cfnTag{ key: jsii.String("key"), value: jsii.String("value"), }, }, })
func NewCfnDBSubnetGroup ¶
func NewCfnDBSubnetGroup(scope constructs.Construct, id *string, props *CfnDBSubnetGroupProps) CfnDBSubnetGroup
Create a new `AWS::DocDB::DBSubnetGroup`.
type CfnDBSubnetGroupProps ¶
type CfnDBSubnetGroupProps struct { // The description for the subnet group. DbSubnetGroupDescription *string `json:"dbSubnetGroupDescription" yaml:"dbSubnetGroupDescription"` // The Amazon EC2 subnet IDs for the subnet group. SubnetIds *[]*string `json:"subnetIds" yaml:"subnetIds"` // The name for the subnet group. This value is stored as a lowercase string. // // Constraints: Must contain no more than 255 letters, numbers, periods, underscores, spaces, or hyphens. Must not be default. // // Example: `mySubnetgroup`. DbSubnetGroupName *string `json:"dbSubnetGroupName" yaml:"dbSubnetGroupName"` // The tags to be assigned to the subnet group. Tags *[]*awscdk.CfnTag `json:"tags" yaml:"tags"` }
Properties for defining a `CfnDBSubnetGroup`.
Example:
import awscdk "github.com/aws/aws-cdk-go/awscdk"import docdb "github.com/aws/aws-cdk-go/awscdk/aws_docdb" cfnDBSubnetGroupProps := &cfnDBSubnetGroupProps{ dbSubnetGroupDescription: jsii.String("dbSubnetGroupDescription"), subnetIds: []*string{ jsii.String("subnetIds"), }, // the properties below are optional dbSubnetGroupName: jsii.String("dbSubnetGroupName"), tags: []cfnTag{ &cfnTag{ key: jsii.String("key"), value: jsii.String("value"), }, }, }
type ClusterParameterGroup ¶
type ClusterParameterGroup interface { awscdk.Resource IClusterParameterGroup // 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. Env() *awscdk.ResourceEnvironment // The tree node. Node() constructs.Node // The name of the parameter group. ParameterGroupName() *string // 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. PhysicalName() *string // The stack in which this resource is defined. Stack() awscdk.Stack // 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`). ApplyRemovalPolicy(policy awscdk.RemovalPolicy) 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`. 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. GetResourceNameAttribute(nameAttr *string) *string // Returns a string representation of this construct. ToString() *string }
A cluster parameter group.
Example:
import awscdk "github.com/aws/aws-cdk-go/awscdk"import docdb "github.com/aws/aws-cdk-go/awscdk/aws_docdb" clusterParameterGroup := docdb.NewClusterParameterGroup(this, jsii.String("MyClusterParameterGroup"), &clusterParameterGroupProps{ family: jsii.String("family"), parameters: map[string]*string{ "parametersKey": jsii.String("parameters"), }, // the properties below are optional dbClusterParameterGroupName: jsii.String("dbClusterParameterGroupName"), description: jsii.String("description"), })
func NewClusterParameterGroup ¶
func NewClusterParameterGroup(scope constructs.Construct, id *string, props *ClusterParameterGroupProps) ClusterParameterGroup
type ClusterParameterGroupProps ¶
type ClusterParameterGroupProps struct { // Database family of this parameter group. Family *string `json:"family" yaml:"family"` // The parameters in this parameter group. Parameters *map[string]*string `json:"parameters" yaml:"parameters"` // The name of the cluster parameter group. DbClusterParameterGroupName *string `json:"dbClusterParameterGroupName" yaml:"dbClusterParameterGroupName"` // Description for this parameter group. Description *string `json:"description" yaml:"description"` }
Properties for a cluster parameter group.
Example:
import awscdk "github.com/aws/aws-cdk-go/awscdk"import docdb "github.com/aws/aws-cdk-go/awscdk/aws_docdb" clusterParameterGroupProps := &clusterParameterGroupProps{ family: jsii.String("family"), parameters: map[string]*string{ "parametersKey": jsii.String("parameters"), }, // the properties below are optional dbClusterParameterGroupName: jsii.String("dbClusterParameterGroupName"), description: jsii.String("description"), }
type DatabaseCluster ¶
type DatabaseCluster interface { awscdk.Resource IDatabaseCluster // The endpoint to use for read/write operations. ClusterEndpoint() Endpoint // Identifier of the cluster. ClusterIdentifier() *string // Endpoint to use for load-balanced read-only operations. ClusterReadEndpoint() Endpoint // The resource id for the cluster; // // for example: cluster-ABCD1234EFGH5678IJKL90MNOP. The cluster ID uniquely // identifies the cluster and is used in things like IAM authentication policies. ClusterResourceIdentifier() *string // The connections object to implement IConnectable. Connections() awsec2.Connections // 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. Env() *awscdk.ResourceEnvironment // Endpoints which address each individual replica. InstanceEndpoints() *[]Endpoint // Identifiers of the replicas. InstanceIdentifiers() *[]*string // The tree node. 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. PhysicalName() *string // The secret attached to this cluster. Secret() awssecretsmanager.ISecret // Security group identifier of this database. SecurityGroupId() *string // The stack in which this resource is defined. Stack() awscdk.Stack // Adds the multi user rotation to this cluster. AddRotationMultiUser(id *string, options *RotationMultiUserOptions) awssecretsmanager.SecretRotation // Adds the single user rotation of the master password to this cluster. AddRotationSingleUser(automaticallyAfter awscdk.Duration) awssecretsmanager.SecretRotation // Adds security groups to this cluster. AddSecurityGroups(securityGroups ...awsec2.ISecurityGroup) // 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`). ApplyRemovalPolicy(policy awscdk.RemovalPolicy) // Renders the secret attachment target specifications. AsSecretAttachmentTarget() *awssecretsmanager.SecretAttachmentTargetProps 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`. 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. GetResourceNameAttribute(nameAttr *string) *string // Returns a string representation of this construct. ToString() *string }
Create a clustered database with a given number of instances.
Example:
var vpc vpc cluster := docdb.NewDatabaseCluster(this, jsii.String("Database"), &databaseClusterProps{ masterUser: &login{ username: jsii.String("myuser"), // NOTE: 'admin' is reserved by DocumentDB excludeCharacters: jsii.String("\"@/:"), // optional, defaults to the set "\"@/" and is also used for eventually created rotations secretName: jsii.String("/myapp/mydocdb/masteruser"), }, instanceType: ec2.instanceType.of(ec2.instanceClass_R5, ec2.instanceSize_LARGE), vpcSubnets: &subnetSelection{ subnetType: ec2.subnetType_PUBLIC, }, vpc: vpc, })
func NewDatabaseCluster ¶
func NewDatabaseCluster(scope constructs.Construct, id *string, props *DatabaseClusterProps) DatabaseCluster
type DatabaseClusterAttributes ¶
type DatabaseClusterAttributes struct { // Cluster endpoint address. ClusterEndpointAddress *string `json:"clusterEndpointAddress" yaml:"clusterEndpointAddress"` // Identifier for the cluster. ClusterIdentifier *string `json:"clusterIdentifier" yaml:"clusterIdentifier"` // Endpoint addresses of individual instances. InstanceEndpointAddresses *[]*string `json:"instanceEndpointAddresses" yaml:"instanceEndpointAddresses"` // Identifier for the instances. InstanceIdentifiers *[]*string `json:"instanceIdentifiers" yaml:"instanceIdentifiers"` // The database port. Port *float64 `json:"port" yaml:"port"` // Reader endpoint address. ReaderEndpointAddress *string `json:"readerEndpointAddress" yaml:"readerEndpointAddress"` // The security group of the database cluster. SecurityGroup awsec2.ISecurityGroup `json:"securityGroup" yaml:"securityGroup"` }
Properties that describe an existing cluster instance.
Example:
import awscdk "github.com/aws/aws-cdk-go/awscdk"import docdb "github.com/aws/aws-cdk-go/awscdk/aws_docdb"import awscdk "github.com/aws/aws-cdk-go/awscdk"import ec2 "github.com/aws/aws-cdk-go/awscdk/aws_ec2" var securityGroup securityGroup databaseClusterAttributes := &databaseClusterAttributes{ clusterEndpointAddress: jsii.String("clusterEndpointAddress"), clusterIdentifier: jsii.String("clusterIdentifier"), instanceEndpointAddresses: []*string{ jsii.String("instanceEndpointAddresses"), }, instanceIdentifiers: []*string{ jsii.String("instanceIdentifiers"), }, port: jsii.Number(123), readerEndpointAddress: jsii.String("readerEndpointAddress"), securityGroup: securityGroup, }
type DatabaseClusterProps ¶
type DatabaseClusterProps struct { // What type of instance to start for the replicas. InstanceType awsec2.InstanceType `json:"instanceType" yaml:"instanceType"` // Username and password for the administrative user. MasterUser *Login `json:"masterUser" yaml:"masterUser"` // What subnets to run the DocumentDB instances in. // // Must be at least 2 subnets in two different AZs. Vpc awsec2.IVpc `json:"vpc" yaml:"vpc"` // Backup settings. // See: https://docs.aws.amazon.com/documentdb/latest/developerguide/backup-restore.db-cluster-snapshots.html#backup-restore.backup-window // Backup *BackupProps `json:"backup" yaml:"backup"` // The number of days log events are kept in CloudWatch Logs. // // When updating // this property, unsetting it doesn't remove the log retention policy. To // remove the retention policy, set the value to `Infinity`. CloudWatchLogsRetention awslogs.RetentionDays `json:"cloudWatchLogsRetention" yaml:"cloudWatchLogsRetention"` // The IAM role for the Lambda function associated with the custom resource that sets the retention policy. CloudWatchLogsRetentionRole awsiam.IRole `json:"cloudWatchLogsRetentionRole" yaml:"cloudWatchLogsRetentionRole"` // An optional identifier for the cluster. DbClusterName *string `json:"dbClusterName" yaml:"dbClusterName"` // Specifies whether this cluster can be deleted. // // If deletionProtection is // enabled, the cluster cannot be deleted unless it is modified and // deletionProtection is disabled. deletionProtection protects clusters from // being accidentally deleted. DeletionProtection *bool `json:"deletionProtection" yaml:"deletionProtection"` // What version of the database to start. EngineVersion *string `json:"engineVersion" yaml:"engineVersion"` // Whether the audit logs should be exported to CloudWatch. // // Note that you also have to configure the audit log export in the Cluster's Parameter Group. // See: https://docs.aws.amazon.com/documentdb/latest/developerguide/event-auditing.html#event-auditing-enabling-auditing // ExportAuditLogsToCloudWatch *bool `json:"exportAuditLogsToCloudWatch" yaml:"exportAuditLogsToCloudWatch"` // Whether the profiler logs should be exported to CloudWatch. // // Note that you also have to configure the profiler log export in the Cluster's Parameter Group. // See: https://docs.aws.amazon.com/documentdb/latest/developerguide/profiling.html#profiling.enable-profiling // ExportProfilerLogsToCloudWatch *bool `json:"exportProfilerLogsToCloudWatch" yaml:"exportProfilerLogsToCloudWatch"` // Base identifier for instances. // // Every replica is named by appending the replica number to this string, 1-based. InstanceIdentifierBase *string `json:"instanceIdentifierBase" yaml:"instanceIdentifierBase"` // Number of DocDB compute instances. Instances *float64 `json:"instances" yaml:"instances"` // The KMS key for storage encryption. KmsKey awskms.IKey `json:"kmsKey" yaml:"kmsKey"` // The DB parameter group to associate with the instance. ParameterGroup IClusterParameterGroup `json:"parameterGroup" yaml:"parameterGroup"` // The port the DocumentDB cluster will listen on. Port *float64 `json:"port" yaml:"port"` // A weekly time range in which maintenance should preferably execute. // // Must be at least 30 minutes long. // // Example: 'tue:04:17-tue:04:47'. // See: https://docs.aws.amazon.com/documentdb/latest/developerguide/db-instance-maintain.html#maintenance-window // PreferredMaintenanceWindow *string `json:"preferredMaintenanceWindow" yaml:"preferredMaintenanceWindow"` // The removal policy to apply when the cluster and its instances are removed or replaced during a stack update, or when the stack is deleted. // // This // removal policy also applies to the implicit security group created for the // cluster if one is not supplied as a parameter. RemovalPolicy awscdk.RemovalPolicy `json:"removalPolicy" yaml:"removalPolicy"` // Security group. SecurityGroup awsec2.ISecurityGroup `json:"securityGroup" yaml:"securityGroup"` // Whether to enable storage encryption. StorageEncrypted *bool `json:"storageEncrypted" yaml:"storageEncrypted"` // Where to place the instances within the VPC. VpcSubnets *awsec2.SubnetSelection `json:"vpcSubnets" yaml:"vpcSubnets"` }
Properties for a new database cluster.
Example:
var vpc vpc cluster := docdb.NewDatabaseCluster(this, jsii.String("Database"), &databaseClusterProps{ masterUser: &login{ username: jsii.String("myuser"), // NOTE: 'admin' is reserved by DocumentDB excludeCharacters: jsii.String("\"@/:"), // optional, defaults to the set "\"@/" and is also used for eventually created rotations secretName: jsii.String("/myapp/mydocdb/masteruser"), }, instanceType: ec2.instanceType.of(ec2.instanceClass_R5, ec2.instanceSize_LARGE), vpcSubnets: &subnetSelection{ subnetType: ec2.subnetType_PUBLIC, }, vpc: vpc, })
type DatabaseInstance ¶
type DatabaseInstance interface { awscdk.Resource IDatabaseInstance // The instance's database cluster. Cluster() IDatabaseCluster // The instance endpoint address. DbInstanceEndpointAddress() *string // The instance endpoint port. DbInstanceEndpointPort() *string // 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. Env() *awscdk.ResourceEnvironment // The instance arn. InstanceArn() *string // The instance endpoint. InstanceEndpoint() Endpoint // The instance identifier. InstanceIdentifier() *string // The tree node. 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. PhysicalName() *string // The stack in which this resource is defined. Stack() awscdk.Stack // 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`). ApplyRemovalPolicy(policy awscdk.RemovalPolicy) 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`. 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. GetResourceNameAttribute(nameAttr *string) *string // Returns a string representation of this construct. ToString() *string }
A database instance.
Example:
import cdk "github.com/aws/aws-cdk-go/awscdk"import awscdk "github.com/aws/aws-cdk-go/awscdk"import docdb "github.com/aws/aws-cdk-go/awscdk/aws_docdb"import awscdk "github.com/aws/aws-cdk-go/awscdk"import ec2 "github.com/aws/aws-cdk-go/awscdk/aws_ec2" var databaseCluster databaseCluster var instanceType instanceType databaseInstance := docdb.NewDatabaseInstance(this, jsii.String("MyDatabaseInstance"), &databaseInstanceProps{ cluster: databaseCluster, instanceType: instanceType, // the properties below are optional autoMinorVersionUpgrade: jsii.Boolean(false), availabilityZone: jsii.String("availabilityZone"), dbInstanceName: jsii.String("dbInstanceName"), preferredMaintenanceWindow: jsii.String("preferredMaintenanceWindow"), removalPolicy: cdk.removalPolicy_DESTROY, })
func NewDatabaseInstance ¶
func NewDatabaseInstance(scope constructs.Construct, id *string, props *DatabaseInstanceProps) DatabaseInstance
type DatabaseInstanceAttributes ¶
type DatabaseInstanceAttributes struct { // The endpoint address. InstanceEndpointAddress *string `json:"instanceEndpointAddress" yaml:"instanceEndpointAddress"` // The instance identifier. InstanceIdentifier *string `json:"instanceIdentifier" yaml:"instanceIdentifier"` // The database port. Port *float64 `json:"port" yaml:"port"` }
Properties that describe an existing instance.
Example:
import awscdk "github.com/aws/aws-cdk-go/awscdk"import docdb "github.com/aws/aws-cdk-go/awscdk/aws_docdb" databaseInstanceAttributes := &databaseInstanceAttributes{ instanceEndpointAddress: jsii.String("instanceEndpointAddress"), instanceIdentifier: jsii.String("instanceIdentifier"), port: jsii.Number(123), }
type DatabaseInstanceProps ¶
type DatabaseInstanceProps struct { // The DocumentDB database cluster the instance should launch into. Cluster IDatabaseCluster `json:"cluster" yaml:"cluster"` // The name of the compute and memory capacity classes. InstanceType awsec2.InstanceType `json:"instanceType" yaml:"instanceType"` // Indicates that minor engine upgrades are applied automatically to the DB instance during the maintenance window. AutoMinorVersionUpgrade *bool `json:"autoMinorVersionUpgrade" yaml:"autoMinorVersionUpgrade"` // The name of the Availability Zone where the DB instance will be located. AvailabilityZone *string `json:"availabilityZone" yaml:"availabilityZone"` // A name for the DB instance. // // If you specify a name, AWS CloudFormation // converts it to lowercase. DbInstanceName *string `json:"dbInstanceName" yaml:"dbInstanceName"` // The weekly time range (in UTC) during which system maintenance can occur. // // Format: `ddd:hh24:mi-ddd:hh24:mi` // Constraint: Minimum 30-minute window. PreferredMaintenanceWindow *string `json:"preferredMaintenanceWindow" yaml:"preferredMaintenanceWindow"` // The CloudFormation policy to apply when the instance is removed from the stack or replaced during an update. RemovalPolicy awscdk.RemovalPolicy `json:"removalPolicy" yaml:"removalPolicy"` }
Construction properties for a DatabaseInstanceNew.
Example:
import cdk "github.com/aws/aws-cdk-go/awscdk"import awscdk "github.com/aws/aws-cdk-go/awscdk"import docdb "github.com/aws/aws-cdk-go/awscdk/aws_docdb"import awscdk "github.com/aws/aws-cdk-go/awscdk"import ec2 "github.com/aws/aws-cdk-go/awscdk/aws_ec2" var databaseCluster databaseCluster var instanceType instanceType databaseInstanceProps := &databaseInstanceProps{ cluster: databaseCluster, instanceType: instanceType, // the properties below are optional autoMinorVersionUpgrade: jsii.Boolean(false), availabilityZone: jsii.String("availabilityZone"), dbInstanceName: jsii.String("dbInstanceName"), preferredMaintenanceWindow: jsii.String("preferredMaintenanceWindow"), removalPolicy: cdk.removalPolicy_DESTROY, }
type DatabaseSecret ¶
type DatabaseSecret interface { awssecretsmanager.Secret // Provides an identifier for this secret for use in IAM policies. // // If there is a full ARN, this is just the ARN; // if we have a partial ARN -- due to either importing by secret name or partial ARN -- // then we need to add a suffix to capture the full ARN's format. ArnForPolicies() *string AutoCreatePolicy() *bool // The customer-managed encryption key that is used to encrypt this secret, if any. // // When not specified, the default // KMS key for the account and region is being used. EncryptionKey() awskms.IKey // 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. Env() *awscdk.ResourceEnvironment // The tree node. 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. PhysicalName() *string // The ARN of the secret in AWS Secrets Manager. // // Will return the full ARN if available, otherwise a partial arn. // For secrets imported by the deprecated `fromSecretName`, it will return the `secretName`. SecretArn() *string // The full ARN of the secret in AWS Secrets Manager, which is the ARN including the Secrets Manager-supplied 6-character suffix. // // This is equal to `secretArn` in most cases, but is undefined when a full ARN is not available (e.g., secrets imported by name). SecretFullArn() *string // The name of the secret. // // For "owned" secrets, this will be the full resource name (secret name + suffix), unless the // '@aws-cdk/aws-secretsmanager:parseOwnedSecretName' feature flag is set. SecretName() *string // Retrieve the value of the stored secret as a `SecretValue`. SecretValue() awscdk.SecretValue // The stack in which this resource is defined. Stack() awscdk.Stack // Adds a replica region for the secret. AddReplicaRegion(region *string, encryptionKey awskms.IKey) // Adds a rotation schedule to the secret. AddRotationSchedule(id *string, options *awssecretsmanager.RotationScheduleOptions) awssecretsmanager.RotationSchedule // Adds a statement to the IAM resource policy associated with this secret. // // If this secret was created in this stack, a resource policy will be // automatically created upon the first call to `addToResourcePolicy`. If // the secret is imported, then this is a no-op. AddToResourcePolicy(statement awsiam.PolicyStatement) *awsiam.AddToResourcePolicyResult // 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`). ApplyRemovalPolicy(policy awscdk.RemovalPolicy) // Attach a target to this secret. // // Returns: An attached secret. Attach(target awssecretsmanager.ISecretAttachmentTarget) awssecretsmanager.ISecret // Denies the `DeleteSecret` action to all principals within the current account. DenyAccountRootDelete() 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`. 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. GetResourceNameAttribute(nameAttr *string) *string // Grants reading the secret value to some role. GrantRead(grantee awsiam.IGrantable, versionStages *[]*string) awsiam.Grant // Grants writing and updating the secret value to some role. GrantWrite(grantee awsiam.IGrantable) awsiam.Grant // Interpret the secret as a JSON object and return a field's value from it as a `SecretValue`. SecretValueFromJson(jsonField *string) awscdk.SecretValue // Returns a string representation of this construct. ToString() *string }
A database secret.
Example:
var cluster databaseCluster myUserSecret := docdb.NewDatabaseSecret(this, jsii.String("MyUserSecret"), &databaseSecretProps{ username: jsii.String("myuser"), masterSecret: cluster.secret, }) myUserSecretAttached := myUserSecret.attach(cluster) // Adds DB connections information in the secret cluster.addRotationMultiUser(jsii.String("MyUser"), &rotationMultiUserOptions{ // Add rotation using the multi user scheme secret: myUserSecretAttached, })
func NewDatabaseSecret ¶
func NewDatabaseSecret(scope constructs.Construct, id *string, props *DatabaseSecretProps) DatabaseSecret
type DatabaseSecretProps ¶
type DatabaseSecretProps struct { // The username. Username *string `json:"username" yaml:"username"` // The KMS key to use to encrypt the secret. EncryptionKey awskms.IKey `json:"encryptionKey" yaml:"encryptionKey"` // Characters to not include in the generated password. ExcludeCharacters *string `json:"excludeCharacters" yaml:"excludeCharacters"` // The master secret which will be used to rotate this secret. MasterSecret awssecretsmanager.ISecret `json:"masterSecret" yaml:"masterSecret"` // The physical name of the secret. SecretName *string `json:"secretName" yaml:"secretName"` }
Construction properties for a DatabaseSecret.
Example:
var cluster databaseCluster myUserSecret := docdb.NewDatabaseSecret(this, jsii.String("MyUserSecret"), &databaseSecretProps{ username: jsii.String("myuser"), masterSecret: cluster.secret, }) myUserSecretAttached := myUserSecret.attach(cluster) // Adds DB connections information in the secret cluster.addRotationMultiUser(jsii.String("MyUser"), &rotationMultiUserOptions{ // Add rotation using the multi user scheme secret: myUserSecretAttached, })
type Endpoint ¶
type Endpoint interface { // The hostname of the endpoint. Hostname() *string // The port number of the endpoint. // // This can potentially be a CDK token. If you need to embed the port in a string (e.g. instance user data script), // use {@link Endpoint.portAsString}. Port() *float64 // The combination of “HOSTNAME:PORT“ for this endpoint. SocketAddress() *string // Returns the port number as a string representation that can be used for embedding within other strings. // // This is intended to deal with CDK's token system. Numeric CDK tokens are not expanded when their string // representation is embedded in a string. This function returns the port either as an unresolved string token or // as a resolved string representation of the port value. // // Returns: An (un)resolved string representation of the endpoint's port number. PortAsString() *string }
Connection endpoint of a database cluster or instance.
Consists of a combination of hostname and port.
Example:
import awscdk "github.com/aws/aws-cdk-go/awscdk"import docdb "github.com/aws/aws-cdk-go/awscdk/aws_docdb" endpoint := docdb.NewEndpoint(jsii.String("address"), jsii.Number(123))
func NewEndpoint ¶
Constructs an Endpoint instance.
type IClusterParameterGroup ¶
type IClusterParameterGroup interface { awscdk.IResource // The name of this parameter group. ParameterGroupName() *string }
A parameter group.
func ClusterParameterGroup_FromParameterGroupName ¶
func ClusterParameterGroup_FromParameterGroupName(scope constructs.Construct, id *string, parameterGroupName *string) IClusterParameterGroup
Imports a parameter group.
type IDatabaseCluster ¶
type IDatabaseCluster interface { awsec2.IConnectable awscdk.IResource awssecretsmanager.ISecretAttachmentTarget // The endpoint to use for read/write operations. ClusterEndpoint() Endpoint // Identifier of the cluster. ClusterIdentifier() *string // Endpoint to use for load-balanced read-only operations. ClusterReadEndpoint() Endpoint // Endpoints which address each individual replica. InstanceEndpoints() *[]Endpoint // Identifiers of the replicas. InstanceIdentifiers() *[]*string // The security group for this database cluster. SecurityGroupId() *string }
Create a clustered database with a given number of instances.
func DatabaseCluster_FromDatabaseClusterAttributes ¶
func DatabaseCluster_FromDatabaseClusterAttributes(scope constructs.Construct, id *string, attrs *DatabaseClusterAttributes) IDatabaseCluster
Import an existing DatabaseCluster from properties.
type IDatabaseInstance ¶
type IDatabaseInstance interface { awscdk.IResource // The instance endpoint address. DbInstanceEndpointAddress() *string // The instance endpoint port. DbInstanceEndpointPort() *string // The instance arn. InstanceArn() *string // The instance endpoint. InstanceEndpoint() Endpoint // The instance identifier. InstanceIdentifier() *string }
A database instance.
func DatabaseInstance_FromDatabaseInstanceAttributes ¶
func DatabaseInstance_FromDatabaseInstanceAttributes(scope constructs.Construct, id *string, attrs *DatabaseInstanceAttributes) IDatabaseInstance
Import an existing database instance.
type Login ¶
type Login struct { // Username. Username *string `json:"username" yaml:"username"` // Specifies characters to not include in generated passwords. ExcludeCharacters *string `json:"excludeCharacters" yaml:"excludeCharacters"` // KMS encryption key to encrypt the generated secret. KmsKey awskms.IKey `json:"kmsKey" yaml:"kmsKey"` // Password. // // Do not put passwords in your CDK code directly. Password awscdk.SecretValue `json:"password" yaml:"password"` // The physical name of the secret, that will be generated. SecretName *string `json:"secretName" yaml:"secretName"` }
Login credentials for a database cluster.
Example:
var vpc vpc cluster := docdb.NewDatabaseCluster(this, jsii.String("Database"), &databaseClusterProps{ masterUser: &login{ username: jsii.String("myuser"), // NOTE: 'admin' is reserved by DocumentDB excludeCharacters: jsii.String("\"@/:"), // optional, defaults to the set "\"@/" and is also used for eventually created rotations secretName: jsii.String("/myapp/mydocdb/masteruser"), }, instanceType: ec2.instanceType.of(ec2.instanceClass_R5, ec2.instanceSize_LARGE), vpcSubnets: &subnetSelection{ subnetType: ec2.subnetType_PUBLIC, }, vpc: vpc, })
type RotationMultiUserOptions ¶
type RotationMultiUserOptions struct { // The secret to rotate. // // It must be a JSON string with the following format: // “` // { // "engine": <required: must be set to 'mongo'>, // "host": <required: instance host name>, // "username": <required: username>, // "password": <required: password>, // "dbname": <optional: database name>, // "port": <optional: if not specified, default port 27017 will be used>, // "masterarn": <required: the arn of the master secret which will be used to create users/change passwords> // "ssl": <optional: if not specified, defaults to false. This must be true if being used for DocumentDB rotations // where the cluster has TLS enabled> // } // “`. Secret awssecretsmanager.ISecret `json:"secret" yaml:"secret"` // Specifies the number of days after the previous rotation before Secrets Manager triggers the next automatic rotation. AutomaticallyAfter awscdk.Duration `json:"automaticallyAfter" yaml:"automaticallyAfter"` }
Options to add the multi user rotation.
Example:
import secretsmanager "github.com/aws/aws-cdk-go/awscdk" var myImportedSecret secret var cluster databaseCluster cluster.addRotationMultiUser(jsii.String("MyUser"), &rotationMultiUserOptions{ secret: myImportedSecret, })