Documentation ¶
Index ¶
- func AliasTargetInstance_IsConstruct(x interface{}) *bool
- func AliasTargetInstance_IsOwnedResource(construct constructs.IConstruct) *bool
- func AliasTargetInstance_IsResource(construct constructs.IConstruct) *bool
- func CfnHttpNamespace_CFN_RESOURCE_TYPE_NAME() *string
- func CfnHttpNamespace_IsCfnElement(x interface{}) *bool
- func CfnHttpNamespace_IsCfnResource(construct constructs.IConstruct) *bool
- func CfnHttpNamespace_IsConstruct(x interface{}) *bool
- func CfnInstance_CFN_RESOURCE_TYPE_NAME() *string
- func CfnInstance_IsCfnElement(x interface{}) *bool
- func CfnInstance_IsCfnResource(construct constructs.IConstruct) *bool
- func CfnInstance_IsConstruct(x interface{}) *bool
- func CfnPrivateDnsNamespace_CFN_RESOURCE_TYPE_NAME() *string
- func CfnPrivateDnsNamespace_IsCfnElement(x interface{}) *bool
- func CfnPrivateDnsNamespace_IsCfnResource(construct constructs.IConstruct) *bool
- func CfnPrivateDnsNamespace_IsConstruct(x interface{}) *bool
- func CfnPublicDnsNamespace_CFN_RESOURCE_TYPE_NAME() *string
- func CfnPublicDnsNamespace_IsCfnElement(x interface{}) *bool
- func CfnPublicDnsNamespace_IsCfnResource(construct constructs.IConstruct) *bool
- func CfnPublicDnsNamespace_IsConstruct(x interface{}) *bool
- func CfnService_CFN_RESOURCE_TYPE_NAME() *string
- func CfnService_IsCfnElement(x interface{}) *bool
- func CfnService_IsCfnResource(construct constructs.IConstruct) *bool
- func CfnService_IsConstruct(x interface{}) *bool
- func CnameInstance_IsConstruct(x interface{}) *bool
- func CnameInstance_IsOwnedResource(construct constructs.IConstruct) *bool
- func CnameInstance_IsResource(construct constructs.IConstruct) *bool
- func HttpNamespace_IsConstruct(x interface{}) *bool
- func HttpNamespace_IsOwnedResource(construct constructs.IConstruct) *bool
- func HttpNamespace_IsResource(construct constructs.IConstruct) *bool
- func InstanceBase_IsConstruct(x interface{}) *bool
- func InstanceBase_IsOwnedResource(construct constructs.IConstruct) *bool
- func InstanceBase_IsResource(construct constructs.IConstruct) *bool
- func IpInstance_IsConstruct(x interface{}) *bool
- func IpInstance_IsOwnedResource(construct constructs.IConstruct) *bool
- func IpInstance_IsResource(construct constructs.IConstruct) *bool
- func NewAliasTargetInstance_Override(a AliasTargetInstance, scope constructs.Construct, id *string, ...)
- func NewCfnHttpNamespace_Override(c CfnHttpNamespace, scope constructs.Construct, id *string, ...)
- func NewCfnInstance_Override(c CfnInstance, scope constructs.Construct, id *string, props *CfnInstanceProps)
- func NewCfnPrivateDnsNamespace_Override(c CfnPrivateDnsNamespace, scope constructs.Construct, id *string, ...)
- func NewCfnPublicDnsNamespace_Override(c CfnPublicDnsNamespace, scope constructs.Construct, id *string, ...)
- func NewCfnService_Override(c CfnService, scope constructs.Construct, id *string, props *CfnServiceProps)
- func NewCnameInstance_Override(c CnameInstance, scope constructs.Construct, id *string, ...)
- func NewHttpNamespace_Override(h HttpNamespace, scope constructs.Construct, id *string, ...)
- func NewInstanceBase_Override(i InstanceBase, scope constructs.Construct, id *string, ...)
- func NewIpInstance_Override(i IpInstance, scope constructs.Construct, id *string, props *IpInstanceProps)
- func NewNonIpInstance_Override(n NonIpInstance, scope constructs.Construct, id *string, ...)
- func NewPrivateDnsNamespace_Override(p PrivateDnsNamespace, scope constructs.Construct, id *string, ...)
- func NewPublicDnsNamespace_Override(p PublicDnsNamespace, scope constructs.Construct, id *string, ...)
- func NewService_Override(s Service, scope constructs.Construct, id *string, props *ServiceProps)
- func NonIpInstance_IsConstruct(x interface{}) *bool
- func NonIpInstance_IsOwnedResource(construct constructs.IConstruct) *bool
- func NonIpInstance_IsResource(construct constructs.IConstruct) *bool
- func PrivateDnsNamespace_IsConstruct(x interface{}) *bool
- func PrivateDnsNamespace_IsOwnedResource(construct constructs.IConstruct) *bool
- func PrivateDnsNamespace_IsResource(construct constructs.IConstruct) *bool
- func PublicDnsNamespace_IsConstruct(x interface{}) *bool
- func PublicDnsNamespace_IsOwnedResource(construct constructs.IConstruct) *bool
- func PublicDnsNamespace_IsResource(construct constructs.IConstruct) *bool
- func Service_IsConstruct(x interface{}) *bool
- func Service_IsOwnedResource(construct constructs.IConstruct) *bool
- func Service_IsResource(construct constructs.IConstruct) *bool
- type AliasTargetInstance
- type AliasTargetInstanceProps
- type BaseInstanceProps
- type BaseNamespaceProps
- type BaseServiceProps
- type CfnHttpNamespace
- type CfnHttpNamespaceProps
- type CfnInstance
- type CfnInstanceProps
- type CfnPrivateDnsNamespace
- type CfnPrivateDnsNamespaceProps
- type CfnPrivateDnsNamespace_PrivateDnsPropertiesMutableProperty
- type CfnPrivateDnsNamespace_PropertiesProperty
- type CfnPrivateDnsNamespace_SOAProperty
- type CfnPublicDnsNamespace
- type CfnPublicDnsNamespaceProps
- type CfnPublicDnsNamespace_PropertiesProperty
- type CfnPublicDnsNamespace_PublicDnsPropertiesMutableProperty
- type CfnPublicDnsNamespace_SOAProperty
- type CfnService
- type CfnServiceProps
- type CfnService_DnsConfigProperty
- type CfnService_DnsRecordProperty
- type CfnService_HealthCheckConfigProperty
- type CfnService_HealthCheckCustomConfigProperty
- type CnameInstance
- type CnameInstanceBaseProps
- type CnameInstanceProps
- type DiscoveryType
- type DnsRecordType
- type DnsServiceProps
- type HealthCheckConfig
- type HealthCheckCustomConfig
- type HealthCheckType
- type HttpNamespace
- type HttpNamespaceAttributes
- type HttpNamespaceProps
- type IHttpNamespace
- type IInstance
- type INamespace
- type IPrivateDnsNamespace
- type IPublicDnsNamespace
- type IService
- type InstanceBase
- type IpInstance
- type IpInstanceBaseProps
- type IpInstanceProps
- type NamespaceType
- type NonIpInstance
- type NonIpInstanceBaseProps
- type NonIpInstanceProps
- type PrivateDnsNamespace
- type PrivateDnsNamespaceAttributes
- type PrivateDnsNamespaceProps
- type PublicDnsNamespace
- type PublicDnsNamespaceAttributes
- type PublicDnsNamespaceProps
- type RoutingPolicy
- type Service
- type ServiceAttributes
- type ServiceProps
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AliasTargetInstance_IsConstruct ¶
func AliasTargetInstance_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func AliasTargetInstance_IsOwnedResource ¶ added in v2.32.0
func AliasTargetInstance_IsOwnedResource(construct constructs.IConstruct) *bool
Returns true if the construct was created by CDK, and false otherwise.
func AliasTargetInstance_IsResource ¶
func AliasTargetInstance_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource.
func CfnHttpNamespace_CFN_RESOURCE_TYPE_NAME ¶
func CfnHttpNamespace_CFN_RESOURCE_TYPE_NAME() *string
func CfnHttpNamespace_IsCfnElement ¶
func CfnHttpNamespace_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 CfnHttpNamespace_IsCfnResource ¶
func CfnHttpNamespace_IsCfnResource(construct constructs.IConstruct) *bool
Check whether the given construct is a CfnResource.
func CfnHttpNamespace_IsConstruct ¶
func CfnHttpNamespace_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func CfnInstance_CFN_RESOURCE_TYPE_NAME ¶
func CfnInstance_CFN_RESOURCE_TYPE_NAME() *string
func CfnInstance_IsCfnElement ¶
func CfnInstance_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 CfnInstance_IsCfnResource ¶
func CfnInstance_IsCfnResource(construct constructs.IConstruct) *bool
Check whether the given construct is a CfnResource.
func CfnInstance_IsConstruct ¶
func CfnInstance_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func CfnPrivateDnsNamespace_CFN_RESOURCE_TYPE_NAME ¶
func CfnPrivateDnsNamespace_CFN_RESOURCE_TYPE_NAME() *string
func CfnPrivateDnsNamespace_IsCfnElement ¶
func CfnPrivateDnsNamespace_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 CfnPrivateDnsNamespace_IsCfnResource ¶
func CfnPrivateDnsNamespace_IsCfnResource(construct constructs.IConstruct) *bool
Check whether the given construct is a CfnResource.
func CfnPrivateDnsNamespace_IsConstruct ¶
func CfnPrivateDnsNamespace_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func CfnPublicDnsNamespace_CFN_RESOURCE_TYPE_NAME ¶
func CfnPublicDnsNamespace_CFN_RESOURCE_TYPE_NAME() *string
func CfnPublicDnsNamespace_IsCfnElement ¶
func CfnPublicDnsNamespace_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 CfnPublicDnsNamespace_IsCfnResource ¶
func CfnPublicDnsNamespace_IsCfnResource(construct constructs.IConstruct) *bool
Check whether the given construct is a CfnResource.
func CfnPublicDnsNamespace_IsConstruct ¶
func CfnPublicDnsNamespace_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func CfnService_CFN_RESOURCE_TYPE_NAME ¶
func CfnService_CFN_RESOURCE_TYPE_NAME() *string
func CfnService_IsCfnElement ¶
func CfnService_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 CfnService_IsCfnResource ¶
func CfnService_IsCfnResource(construct constructs.IConstruct) *bool
Check whether the given construct is a CfnResource.
func CfnService_IsConstruct ¶
func CfnService_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func CnameInstance_IsConstruct ¶
func CnameInstance_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func CnameInstance_IsOwnedResource ¶ added in v2.32.0
func CnameInstance_IsOwnedResource(construct constructs.IConstruct) *bool
Returns true if the construct was created by CDK, and false otherwise.
func CnameInstance_IsResource ¶
func CnameInstance_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource.
func HttpNamespace_IsConstruct ¶
func HttpNamespace_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func HttpNamespace_IsOwnedResource ¶ added in v2.32.0
func HttpNamespace_IsOwnedResource(construct constructs.IConstruct) *bool
Returns true if the construct was created by CDK, and false otherwise.
func HttpNamespace_IsResource ¶
func HttpNamespace_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource.
func InstanceBase_IsConstruct ¶
func InstanceBase_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func InstanceBase_IsOwnedResource ¶ added in v2.32.0
func InstanceBase_IsOwnedResource(construct constructs.IConstruct) *bool
Returns true if the construct was created by CDK, and false otherwise.
func InstanceBase_IsResource ¶
func InstanceBase_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource.
func IpInstance_IsConstruct ¶
func IpInstance_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func IpInstance_IsOwnedResource ¶ added in v2.32.0
func IpInstance_IsOwnedResource(construct constructs.IConstruct) *bool
Returns true if the construct was created by CDK, and false otherwise.
func IpInstance_IsResource ¶
func IpInstance_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource.
func NewAliasTargetInstance_Override ¶
func NewAliasTargetInstance_Override(a AliasTargetInstance, scope constructs.Construct, id *string, props *AliasTargetInstanceProps)
func NewCfnHttpNamespace_Override ¶
func NewCfnHttpNamespace_Override(c CfnHttpNamespace, scope constructs.Construct, id *string, props *CfnHttpNamespaceProps)
func NewCfnInstance_Override ¶
func NewCfnInstance_Override(c CfnInstance, scope constructs.Construct, id *string, props *CfnInstanceProps)
func NewCfnPrivateDnsNamespace_Override ¶
func NewCfnPrivateDnsNamespace_Override(c CfnPrivateDnsNamespace, scope constructs.Construct, id *string, props *CfnPrivateDnsNamespaceProps)
func NewCfnPublicDnsNamespace_Override ¶
func NewCfnPublicDnsNamespace_Override(c CfnPublicDnsNamespace, scope constructs.Construct, id *string, props *CfnPublicDnsNamespaceProps)
func NewCfnService_Override ¶
func NewCfnService_Override(c CfnService, scope constructs.Construct, id *string, props *CfnServiceProps)
func NewCnameInstance_Override ¶
func NewCnameInstance_Override(c CnameInstance, scope constructs.Construct, id *string, props *CnameInstanceProps)
func NewHttpNamespace_Override ¶
func NewHttpNamespace_Override(h HttpNamespace, scope constructs.Construct, id *string, props *HttpNamespaceProps)
func NewInstanceBase_Override ¶
func NewInstanceBase_Override(i InstanceBase, scope constructs.Construct, id *string, props *awscdk.ResourceProps)
func NewIpInstance_Override ¶
func NewIpInstance_Override(i IpInstance, scope constructs.Construct, id *string, props *IpInstanceProps)
func NewNonIpInstance_Override ¶
func NewNonIpInstance_Override(n NonIpInstance, scope constructs.Construct, id *string, props *NonIpInstanceProps)
func NewPrivateDnsNamespace_Override ¶
func NewPrivateDnsNamespace_Override(p PrivateDnsNamespace, scope constructs.Construct, id *string, props *PrivateDnsNamespaceProps)
func NewPublicDnsNamespace_Override ¶
func NewPublicDnsNamespace_Override(p PublicDnsNamespace, scope constructs.Construct, id *string, props *PublicDnsNamespaceProps)
func NewService_Override ¶
func NewService_Override(s Service, scope constructs.Construct, id *string, props *ServiceProps)
func NonIpInstance_IsConstruct ¶
func NonIpInstance_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func NonIpInstance_IsOwnedResource ¶ added in v2.32.0
func NonIpInstance_IsOwnedResource(construct constructs.IConstruct) *bool
Returns true if the construct was created by CDK, and false otherwise.
func NonIpInstance_IsResource ¶
func NonIpInstance_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource.
func PrivateDnsNamespace_IsConstruct ¶
func PrivateDnsNamespace_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func PrivateDnsNamespace_IsOwnedResource ¶ added in v2.32.0
func PrivateDnsNamespace_IsOwnedResource(construct constructs.IConstruct) *bool
Returns true if the construct was created by CDK, and false otherwise.
func PrivateDnsNamespace_IsResource ¶
func PrivateDnsNamespace_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource.
func PublicDnsNamespace_IsConstruct ¶
func PublicDnsNamespace_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func PublicDnsNamespace_IsOwnedResource ¶ added in v2.32.0
func PublicDnsNamespace_IsOwnedResource(construct constructs.IConstruct) *bool
Returns true if the construct was created by CDK, and false otherwise.
func PublicDnsNamespace_IsResource ¶
func PublicDnsNamespace_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource.
func Service_IsConstruct ¶
func Service_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func Service_IsOwnedResource ¶ added in v2.32.0
func Service_IsOwnedResource(construct constructs.IConstruct) *bool
Returns true if the construct was created by CDK, and false otherwise.
func Service_IsResource ¶
func Service_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource.
Types ¶
type AliasTargetInstance ¶
type AliasTargetInstance interface { InstanceBase // The Route53 DNS name of the alias target. DnsName() *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 Id of the instance. InstanceId() *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 Cloudmap service to which the instance is registered. Service() IService // 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 // Generate a unique instance Id that is safe to pass to CloudMap. UniqueInstanceId() *string }
Instance that uses Route 53 Alias record type.
Currently, the only resource types supported are Elastic Load Balancers.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" var service service aliasTargetInstance := awscdk.Aws_servicediscovery.NewAliasTargetInstance(this, jsii.String("MyAliasTargetInstance"), &AliasTargetInstanceProps{ DnsName: jsii.String("dnsName"), Service: service, // the properties below are optional CustomAttributes: map[string]*string{ "customAttributesKey": jsii.String("customAttributes"), }, InstanceId: jsii.String("instanceId"), })
func NewAliasTargetInstance ¶
func NewAliasTargetInstance(scope constructs.Construct, id *string, props *AliasTargetInstanceProps) AliasTargetInstance
type AliasTargetInstanceProps ¶
type AliasTargetInstanceProps struct { // Custom attributes of the instance. // Default: none. // CustomAttributes *map[string]*string `field:"optional" json:"customAttributes" yaml:"customAttributes"` // The id of the instance resource. // Default: Automatically generated name. // InstanceId *string `field:"optional" json:"instanceId" yaml:"instanceId"` // DNS name of the target. DnsName *string `field:"required" json:"dnsName" yaml:"dnsName"` // The Cloudmap service this resource is registered to. Service IService `field:"required" json:"service" yaml:"service"` }
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" var service service aliasTargetInstanceProps := &AliasTargetInstanceProps{ DnsName: jsii.String("dnsName"), Service: service, // the properties below are optional CustomAttributes: map[string]*string{ "customAttributesKey": jsii.String("customAttributes"), }, InstanceId: jsii.String("instanceId"), }
type BaseInstanceProps ¶
type BaseInstanceProps struct { // Custom attributes of the instance. // Default: none. // CustomAttributes *map[string]*string `field:"optional" json:"customAttributes" yaml:"customAttributes"` // The id of the instance resource. // Default: Automatically generated name. // InstanceId *string `field:"optional" json:"instanceId" yaml:"instanceId"` }
Used when the resource that's associated with the service instance is accessible using values other than an IP address or a domain name (CNAME), i.e. for non-ip-instances.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" baseInstanceProps := &BaseInstanceProps{ CustomAttributes: map[string]*string{ "customAttributesKey": jsii.String("customAttributes"), }, InstanceId: jsii.String("instanceId"), }
type BaseNamespaceProps ¶
type BaseNamespaceProps struct { // A name for the Namespace. Name *string `field:"required" json:"name" yaml:"name"` // A description of the Namespace. // Default: none. // Description *string `field:"optional" json:"description" yaml:"description"` }
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" baseNamespaceProps := &BaseNamespaceProps{ Name: jsii.String("name"), // the properties below are optional Description: jsii.String("description"), }
type BaseServiceProps ¶
type BaseServiceProps struct { // Structure containing failure threshold for a custom health checker. // // Only one of healthCheckConfig or healthCheckCustomConfig can be specified. // See: https://docs.aws.amazon.com/cloud-map/latest/api/API_HealthCheckCustomConfig.html // Default: none. // CustomHealthCheck *HealthCheckCustomConfig `field:"optional" json:"customHealthCheck" yaml:"customHealthCheck"` // A description of the service. // Default: none. // Description *string `field:"optional" json:"description" yaml:"description"` // Settings for an optional health check. // // If you specify health check settings, AWS Cloud Map associates the health // check with the records that you specify in DnsConfig. Only one of healthCheckConfig or healthCheckCustomConfig can // be specified. Not valid for PrivateDnsNamespaces. If you use healthCheck, you can only register IP instances to // this service. // Default: none. // HealthCheck *HealthCheckConfig `field:"optional" json:"healthCheck" yaml:"healthCheck"` // A name for the Service. // Default: CloudFormation-generated name. // Name *string `field:"optional" json:"name" yaml:"name"` }
Basic props needed to create a service in a given namespace.
Used by HttpNamespace.createService ¶
Example:
import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" app := cdk.NewApp() stack := cdk.NewStack(app, jsii.String("aws-servicediscovery-integ")) namespace := servicediscovery.NewHttpNamespace(stack, jsii.String("MyNamespace"), &HttpNamespaceProps{ Name: jsii.String("MyHTTPNamespace"), }) service1 := namespace.CreateService(jsii.String("NonIpService"), &BaseServiceProps{ Description: jsii.String("service registering non-ip instances"), }) service1.RegisterNonIpInstance(jsii.String("NonIpInstance"), &NonIpInstanceBaseProps{ CustomAttributes: map[string]*string{ "arn": jsii.String("arn:aws:s3:::mybucket"), }, }) service2 := namespace.CreateService(jsii.String("IpService"), &BaseServiceProps{ Description: jsii.String("service registering ip instances"), HealthCheck: &HealthCheckConfig{ Type: servicediscovery.HealthCheckType_HTTP, ResourcePath: jsii.String("/check"), }, }) service2.RegisterIpInstance(jsii.String("IpInstance"), &IpInstanceBaseProps{ Ipv4: jsii.String("54.239.25.192"), }) app.Synth()
type CfnHttpNamespace ¶
type CfnHttpNamespace interface { awscdk.CfnResource awscdk.IInspectable awscdk.ITaggable // The Amazon Resource Name (ARN) of the namespace, such as `arn:aws:service-discovery:us-east-1:123456789012:http-namespace/http-namespace-a1bzhi` . AttrArn() *string // The ID of the namespace. AttrId() *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 // A description for the namespace. Description() *string SetDescription(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 that you want to assign to this namespace. Name() *string SetName(val *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 // Tag Manager which manages the tags for this resource. Tags() awscdk.TagManager // The tags for the namespace. TagsRaw() *[]*awscdk.CfnTag SetTagsRaw(val *[]*awscdk.CfnTag) // Deprecated. // Deprecated: use `updatedProperties` // // 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{} // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperties() *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. AddDependency(target awscdk.CfnResource) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // Deprecated: use addDependency. 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`). In some // cases, a snapshot can be taken of the resource prior to deletion // (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy // can be found in the following link:. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options // 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, typeHint awscdk.ResolutionTypeHint) 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) // Retrieves an array of resources this resource depends on. // // This assembles dependencies on resources across stacks (including nested stacks) // automatically. ObtainDependencies() *[]interface{} // Get a shallow copy of dependencies between this resource and other resources in the same stack. ObtainResourceDependencies() *[]awscdk.CfnResource // Overrides the auto-generated logical ID with a specific ID. OverrideLogicalId(newLogicalId *string) // Indicates that this resource no longer depends on another resource. // // This can be used for resources across stacks (including nested stacks) // and the dependency will automatically be removed from the relevant scope. RemoveDependency(target awscdk.CfnResource) RenderProperties(props *map[string]interface{}) *map[string]interface{} // Replaces one dependency with another. ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource) // 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{}) }
The `HttpNamespace` resource is an AWS Cloud Map resource type that contains information about an HTTP namespace.
Service instances that you register using an HTTP namespace can be discovered using a `DiscoverInstances` request but can't be discovered using DNS.
For the current quota on the number of namespaces that you can create using the same AWS account, see [AWS Cloud Map quotas](https://docs.aws.amazon.com/cloud-map/latest/dg/cloud-map-limits.html) in the ** .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnHttpNamespace := awscdk.Aws_servicediscovery.NewCfnHttpNamespace(this, jsii.String("MyCfnHttpNamespace"), &CfnHttpNamespaceProps{ Name: jsii.String("name"), // the properties below are optional Description: jsii.String("description"), Tags: []cfnTag{ &cfnTag{ Key: jsii.String("key"), Value: jsii.String("value"), }, }, })
func NewCfnHttpNamespace ¶
func NewCfnHttpNamespace(scope constructs.Construct, id *string, props *CfnHttpNamespaceProps) CfnHttpNamespace
type CfnHttpNamespaceProps ¶
type CfnHttpNamespaceProps struct { // The name that you want to assign to this namespace. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicediscovery-httpnamespace.html#cfn-servicediscovery-httpnamespace-name // Name *string `field:"required" json:"name" yaml:"name"` // A description for the namespace. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicediscovery-httpnamespace.html#cfn-servicediscovery-httpnamespace-description // Description *string `field:"optional" json:"description" yaml:"description"` // The tags for the namespace. // // Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicediscovery-httpnamespace.html#cfn-servicediscovery-httpnamespace-tags // Tags *[]*awscdk.CfnTag `field:"optional" json:"tags" yaml:"tags"` }
Properties for defining a `CfnHttpNamespace`.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnHttpNamespaceProps := &CfnHttpNamespaceProps{ Name: jsii.String("name"), // the properties below are optional Description: jsii.String("description"), Tags: []cfnTag{ &cfnTag{ Key: jsii.String("key"), Value: jsii.String("value"), }, }, }
type CfnInstance ¶
type CfnInstance 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 // A string map that contains the following information for the service that you specify in `ServiceId` :. InstanceAttributes() interface{} SetInstanceAttributes(val interface{}) InstanceId() *string SetInstanceId(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 ID of the service that you want to use for settings for the instance. ServiceId() *string SetServiceId(val *string) // The stack in which this element is defined. // // CfnElements must be defined within a stack scope (directly or indirectly). Stack() awscdk.Stack // Deprecated. // Deprecated: use `updatedProperties` // // 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{} // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperties() *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. AddDependency(target awscdk.CfnResource) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // Deprecated: use addDependency. 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`). In some // cases, a snapshot can be taken of the resource prior to deletion // (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy // can be found in the following link:. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options // 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, typeHint awscdk.ResolutionTypeHint) 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) // Retrieves an array of resources this resource depends on. // // This assembles dependencies on resources across stacks (including nested stacks) // automatically. ObtainDependencies() *[]interface{} // Get a shallow copy of dependencies between this resource and other resources in the same stack. ObtainResourceDependencies() *[]awscdk.CfnResource // Overrides the auto-generated logical ID with a specific ID. OverrideLogicalId(newLogicalId *string) // Indicates that this resource no longer depends on another resource. // // This can be used for resources across stacks (including nested stacks) // and the dependency will automatically be removed from the relevant scope. RemoveDependency(target awscdk.CfnResource) RenderProperties(props *map[string]interface{}) *map[string]interface{} // Replaces one dependency with another. ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource) // 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 complex type that contains information about an instance that AWS Cloud Map creates when you submit a `RegisterInstance` request.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" var instanceAttributes interface{} cfnInstance := awscdk.Aws_servicediscovery.NewCfnInstance(this, jsii.String("MyCfnInstance"), &CfnInstanceProps{ InstanceAttributes: instanceAttributes, ServiceId: jsii.String("serviceId"), // the properties below are optional InstanceId: jsii.String("instanceId"), })
func NewCfnInstance ¶
func NewCfnInstance(scope constructs.Construct, id *string, props *CfnInstanceProps) CfnInstance
type CfnInstanceProps ¶
type CfnInstanceProps struct { // A string map that contains the following information for the service that you specify in `ServiceId` :. // // - The attributes that apply to the records that are defined in the service. // - For each attribute, the applicable value. // // Supported attribute keys include the following: // // - **AWS_ALIAS_DNS_NAME** - If you want AWS Cloud Map to create a Route 53 alias record that routes traffic to an Elastic Load Balancing load balancer, specify the DNS name that is associated with the load balancer. For information about how to get the DNS name, see [AliasTarget->DNSName](https://docs.aws.amazon.com/Route53/latest/APIReference/API_AliasTarget.html#Route53-Type-AliasTarget-DNSName) in the *Route 53 API Reference* . // // Note the following: // // - The configuration for the service that is specified by `ServiceId` must include settings for an `A` record, an `AAAA` record, or both. // - In the service that is specified by `ServiceId` , the value of `RoutingPolicy` must be `WEIGHTED` . // - If the service that is specified by `ServiceId` includes `HealthCheckConfig` settings, AWS Cloud Map will create the health check, but it won't associate the health check with the alias record. // - Auto naming currently doesn't support creating alias records that route traffic to AWS resources other than ELB load balancers. // - If you specify a value for `AWS_ALIAS_DNS_NAME` , don't specify values for any of the `AWS_INSTANCE` attributes. // - **AWS_EC2_INSTANCE_ID** - *HTTP namespaces only.* The Amazon EC2 instance ID for the instance. The `AWS_INSTANCE_IPV4` attribute contains the primary private IPv4 address. When creating resources with a type of [AWS::ServiceDiscovery::Instance](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicediscovery-instance.html) , if the `AWS_EC2_INSTANCE_ID` attribute is specified, the only other attribute that can be specified is `AWS_INIT_HEALTH_STATUS` . After the resource has been created, the `AWS_INSTANCE_IPV4` attribute contains the primary private IPv4 address. // - **AWS_INIT_HEALTH_STATUS** - If the service configuration includes `HealthCheckCustomConfig` , when creating resources with a type of [AWS::ServiceDiscovery::Instance](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicediscovery-instance.html) you can optionally use `AWS_INIT_HEALTH_STATUS` to specify the initial status of the custom health check, `HEALTHY` or `UNHEALTHY` . If you don't specify a value for `AWS_INIT_HEALTH_STATUS` , the initial status is `HEALTHY` . This attribute can only be used when creating resources and will not be seen on existing resources. // - **AWS_INSTANCE_CNAME** - If the service configuration includes a `CNAME` record, the domain name that you want Route 53 to return in response to DNS queries, for example, `example.com` . // // This value is required if the service specified by `ServiceId` includes settings for an `CNAME` record. // - **AWS_INSTANCE_IPV4** - If the service configuration includes an `A` record, the IPv4 address that you want Route 53 to return in response to DNS queries, for example, `192.0.2.44` . // // This value is required if the service specified by `ServiceId` includes settings for an `A` record. If the service includes settings for an `SRV` record, you must specify a value for `AWS_INSTANCE_IPV4` , `AWS_INSTANCE_IPV6` , or both. // - **AWS_INSTANCE_IPV6** - If the service configuration includes an `AAAA` record, the IPv6 address that you want Route 53 to return in response to DNS queries, for example, `2001:0db8:85a3:0000:0000:abcd:0001:2345` . // // This value is required if the service specified by `ServiceId` includes settings for an `AAAA` record. If the service includes settings for an `SRV` record, you must specify a value for `AWS_INSTANCE_IPV4` , `AWS_INSTANCE_IPV6` , or both. // - **AWS_INSTANCE_PORT** - If the service includes an `SRV` record, the value that you want Route 53 to return for the port. // // If the service includes `HealthCheckConfig` , the port on the endpoint that you want Route 53 to send requests to. // // This value is required if you specified settings for an `SRV` record or a Route 53 health check when you created the service. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicediscovery-instance.html#cfn-servicediscovery-instance-instanceattributes // InstanceAttributes interface{} `field:"required" json:"instanceAttributes" yaml:"instanceAttributes"` // The ID of the service that you want to use for settings for the instance. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicediscovery-instance.html#cfn-servicediscovery-instance-serviceid // ServiceId *string `field:"required" json:"serviceId" yaml:"serviceId"` // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicediscovery-instance.html#cfn-servicediscovery-instance-instanceid // InstanceId *string `field:"optional" json:"instanceId" yaml:"instanceId"` }
Properties for defining a `CfnInstance`.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" var instanceAttributes interface{} cfnInstanceProps := &CfnInstanceProps{ InstanceAttributes: instanceAttributes, ServiceId: jsii.String("serviceId"), // the properties below are optional InstanceId: jsii.String("instanceId"), }
type CfnPrivateDnsNamespace ¶
type CfnPrivateDnsNamespace interface { awscdk.CfnResource awscdk.IInspectable awscdk.ITaggable // The Amazon Resource Name (ARN) of the private namespace. AttrArn() *string // The ID for the Route 53 hosted zone that AWS Cloud Map creates when you create a namespace. AttrHostedZoneId() *string // The ID of the private namespace. AttrId() *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 // A description for the namespace. Description() *string SetDescription(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 that you want to assign to this namespace. Name() *string SetName(val *string) // The tree node. Node() constructs.Node // Properties for the private DNS namespace. Properties() interface{} SetProperties(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 // Tag Manager which manages the tags for this resource. Tags() awscdk.TagManager // The tags for the namespace. TagsRaw() *[]*awscdk.CfnTag SetTagsRaw(val *[]*awscdk.CfnTag) // Deprecated. // Deprecated: use `updatedProperties` // // 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{} // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperties() *map[string]interface{} // The ID of the Amazon VPC that you want to associate the namespace with. Vpc() *string SetVpc(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. AddDependency(target awscdk.CfnResource) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // Deprecated: use addDependency. 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`). In some // cases, a snapshot can be taken of the resource prior to deletion // (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy // can be found in the following link:. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options // 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, typeHint awscdk.ResolutionTypeHint) 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) // Retrieves an array of resources this resource depends on. // // This assembles dependencies on resources across stacks (including nested stacks) // automatically. ObtainDependencies() *[]interface{} // Get a shallow copy of dependencies between this resource and other resources in the same stack. ObtainResourceDependencies() *[]awscdk.CfnResource // Overrides the auto-generated logical ID with a specific ID. OverrideLogicalId(newLogicalId *string) // Indicates that this resource no longer depends on another resource. // // This can be used for resources across stacks (including nested stacks) // and the dependency will automatically be removed from the relevant scope. RemoveDependency(target awscdk.CfnResource) RenderProperties(props *map[string]interface{}) *map[string]interface{} // Replaces one dependency with another. ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource) // 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{}) }
Creates a private namespace based on DNS, which is visible only inside a specified Amazon VPC.
The namespace defines your service naming scheme. For example, if you name your namespace `example.com` and name your service `backend` , the resulting DNS name for the service is `backend.example.com` . Service instances that are registered using a private DNS namespace can be discovered using either a `DiscoverInstances` request or using DNS. For the current quota on the number of namespaces that you can create using the same AWS account , see [AWS Cloud Map quotas](https://docs.aws.amazon.com/cloud-map/latest/dg/cloud-map-limits.html) in the *AWS Cloud Map Developer Guide* .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnPrivateDnsNamespace := awscdk.Aws_servicediscovery.NewCfnPrivateDnsNamespace(this, jsii.String("MyCfnPrivateDnsNamespace"), &CfnPrivateDnsNamespaceProps{ Name: jsii.String("name"), Vpc: jsii.String("vpc"), // the properties below are optional Description: jsii.String("description"), Properties: &PropertiesProperty{ DnsProperties: &PrivateDnsPropertiesMutableProperty{ Soa: &SOAProperty{ Ttl: jsii.Number(123), }, }, }, Tags: []cfnTag{ &cfnTag{ Key: jsii.String("key"), Value: jsii.String("value"), }, }, })
func NewCfnPrivateDnsNamespace ¶
func NewCfnPrivateDnsNamespace(scope constructs.Construct, id *string, props *CfnPrivateDnsNamespaceProps) CfnPrivateDnsNamespace
type CfnPrivateDnsNamespaceProps ¶
type CfnPrivateDnsNamespaceProps struct { // The name that you want to assign to this namespace. // // When you create a private DNS namespace, AWS Cloud Map automatically creates an Amazon Route 53 private hosted zone that has the same name as the namespace. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicediscovery-privatednsnamespace.html#cfn-servicediscovery-privatednsnamespace-name // Name *string `field:"required" json:"name" yaml:"name"` // The ID of the Amazon VPC that you want to associate the namespace with. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicediscovery-privatednsnamespace.html#cfn-servicediscovery-privatednsnamespace-vpc // Vpc *string `field:"required" json:"vpc" yaml:"vpc"` // A description for the namespace. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicediscovery-privatednsnamespace.html#cfn-servicediscovery-privatednsnamespace-description // Description *string `field:"optional" json:"description" yaml:"description"` // Properties for the private DNS namespace. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicediscovery-privatednsnamespace.html#cfn-servicediscovery-privatednsnamespace-properties // Properties interface{} `field:"optional" json:"properties" yaml:"properties"` // The tags for the namespace. // // Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicediscovery-privatednsnamespace.html#cfn-servicediscovery-privatednsnamespace-tags // Tags *[]*awscdk.CfnTag `field:"optional" json:"tags" yaml:"tags"` }
Properties for defining a `CfnPrivateDnsNamespace`.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnPrivateDnsNamespaceProps := &CfnPrivateDnsNamespaceProps{ Name: jsii.String("name"), Vpc: jsii.String("vpc"), // the properties below are optional Description: jsii.String("description"), Properties: &PropertiesProperty{ DnsProperties: &PrivateDnsPropertiesMutableProperty{ Soa: &SOAProperty{ Ttl: jsii.Number(123), }, }, }, Tags: []cfnTag{ &cfnTag{ Key: jsii.String("key"), Value: jsii.String("value"), }, }, }
type CfnPrivateDnsNamespace_PrivateDnsPropertiesMutableProperty ¶
type CfnPrivateDnsNamespace_PrivateDnsPropertiesMutableProperty struct { // Fields for the Start of Authority (SOA) record for the hosted zone for the private DNS namespace. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-servicediscovery-privatednsnamespace-privatednspropertiesmutable.html#cfn-servicediscovery-privatednsnamespace-privatednspropertiesmutable-soa // Soa interface{} `field:"optional" json:"soa" yaml:"soa"` }
DNS properties for the private DNS namespace.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" privateDnsPropertiesMutableProperty := &PrivateDnsPropertiesMutableProperty{ Soa: &SOAProperty{ Ttl: jsii.Number(123), }, }
type CfnPrivateDnsNamespace_PropertiesProperty ¶
type CfnPrivateDnsNamespace_PropertiesProperty struct { // DNS properties for the private DNS namespace. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-servicediscovery-privatednsnamespace-properties.html#cfn-servicediscovery-privatednsnamespace-properties-dnsproperties // DnsProperties interface{} `field:"optional" json:"dnsProperties" yaml:"dnsProperties"` }
Properties for the private DNS namespace.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" propertiesProperty := &PropertiesProperty{ DnsProperties: &PrivateDnsPropertiesMutableProperty{ Soa: &SOAProperty{ Ttl: jsii.Number(123), }, }, }
type CfnPrivateDnsNamespace_SOAProperty ¶
type CfnPrivateDnsNamespace_SOAProperty struct { // The time to live (TTL) for purposes of negative caching. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-servicediscovery-privatednsnamespace-soa.html#cfn-servicediscovery-privatednsnamespace-soa-ttl // Ttl *float64 `field:"optional" json:"ttl" yaml:"ttl"` }
Start of Authority (SOA) properties for a public or private DNS namespace.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" sOAProperty := &SOAProperty{ Ttl: jsii.Number(123), }
type CfnPublicDnsNamespace ¶
type CfnPublicDnsNamespace interface { awscdk.CfnResource awscdk.IInspectable awscdk.ITaggable // The Amazon Resource Name (ARN) of the public namespace. AttrArn() *string // The ID for the Route 53 hosted zone that AWS Cloud Map creates when you create a namespace. AttrHostedZoneId() *string // The ID of the public namespace. AttrId() *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 // A description for the namespace. Description() *string SetDescription(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 that you want to assign to this namespace. Name() *string SetName(val *string) // The tree node. Node() constructs.Node // Properties for the public DNS namespace. Properties() interface{} SetProperties(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 // Tag Manager which manages the tags for this resource. Tags() awscdk.TagManager // The tags for the namespace. TagsRaw() *[]*awscdk.CfnTag SetTagsRaw(val *[]*awscdk.CfnTag) // Deprecated. // Deprecated: use `updatedProperties` // // 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{} // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperties() *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. AddDependency(target awscdk.CfnResource) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // Deprecated: use addDependency. 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`). In some // cases, a snapshot can be taken of the resource prior to deletion // (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy // can be found in the following link:. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options // 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, typeHint awscdk.ResolutionTypeHint) 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) // Retrieves an array of resources this resource depends on. // // This assembles dependencies on resources across stacks (including nested stacks) // automatically. ObtainDependencies() *[]interface{} // Get a shallow copy of dependencies between this resource and other resources in the same stack. ObtainResourceDependencies() *[]awscdk.CfnResource // Overrides the auto-generated logical ID with a specific ID. OverrideLogicalId(newLogicalId *string) // Indicates that this resource no longer depends on another resource. // // This can be used for resources across stacks (including nested stacks) // and the dependency will automatically be removed from the relevant scope. RemoveDependency(target awscdk.CfnResource) RenderProperties(props *map[string]interface{}) *map[string]interface{} // Replaces one dependency with another. ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource) // 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{}) }
Creates a public namespace based on DNS, which is visible on the internet.
The namespace defines your service naming scheme. For example, if you name your namespace `example.com` and name your service `backend` , the resulting DNS name for the service is `backend.example.com` . You can discover instances that were registered with a public DNS namespace by using either a `DiscoverInstances` request or using DNS. For the current quota on the number of namespaces that you can create using the same AWS account , see [AWS Cloud Map quotas](https://docs.aws.amazon.com/cloud-map/latest/dg/cloud-map-limits.html) in the *AWS Cloud Map Developer Guide* .
> The `CreatePublicDnsNamespace` API operation is not supported in the AWS GovCloud (US) Regions.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnPublicDnsNamespace := awscdk.Aws_servicediscovery.NewCfnPublicDnsNamespace(this, jsii.String("MyCfnPublicDnsNamespace"), &CfnPublicDnsNamespaceProps{ Name: jsii.String("name"), // the properties below are optional Description: jsii.String("description"), Properties: &PropertiesProperty{ DnsProperties: &PublicDnsPropertiesMutableProperty{ Soa: &SOAProperty{ Ttl: jsii.Number(123), }, }, }, Tags: []cfnTag{ &cfnTag{ Key: jsii.String("key"), Value: jsii.String("value"), }, }, })
func NewCfnPublicDnsNamespace ¶
func NewCfnPublicDnsNamespace(scope constructs.Construct, id *string, props *CfnPublicDnsNamespaceProps) CfnPublicDnsNamespace
type CfnPublicDnsNamespaceProps ¶
type CfnPublicDnsNamespaceProps struct { // The name that you want to assign to this namespace. // // > Do not include sensitive information in the name. The name is publicly available using DNS queries. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicediscovery-publicdnsnamespace.html#cfn-servicediscovery-publicdnsnamespace-name // Name *string `field:"required" json:"name" yaml:"name"` // A description for the namespace. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicediscovery-publicdnsnamespace.html#cfn-servicediscovery-publicdnsnamespace-description // Description *string `field:"optional" json:"description" yaml:"description"` // Properties for the public DNS namespace. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicediscovery-publicdnsnamespace.html#cfn-servicediscovery-publicdnsnamespace-properties // Properties interface{} `field:"optional" json:"properties" yaml:"properties"` // The tags for the namespace. // // Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicediscovery-publicdnsnamespace.html#cfn-servicediscovery-publicdnsnamespace-tags // Tags *[]*awscdk.CfnTag `field:"optional" json:"tags" yaml:"tags"` }
Properties for defining a `CfnPublicDnsNamespace`.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnPublicDnsNamespaceProps := &CfnPublicDnsNamespaceProps{ Name: jsii.String("name"), // the properties below are optional Description: jsii.String("description"), Properties: &PropertiesProperty{ DnsProperties: &PublicDnsPropertiesMutableProperty{ Soa: &SOAProperty{ Ttl: jsii.Number(123), }, }, }, Tags: []cfnTag{ &cfnTag{ Key: jsii.String("key"), Value: jsii.String("value"), }, }, }
type CfnPublicDnsNamespace_PropertiesProperty ¶
type CfnPublicDnsNamespace_PropertiesProperty struct { // DNS properties for the public DNS namespace. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-servicediscovery-publicdnsnamespace-properties.html#cfn-servicediscovery-publicdnsnamespace-properties-dnsproperties // DnsProperties interface{} `field:"optional" json:"dnsProperties" yaml:"dnsProperties"` }
Properties for the public DNS namespace.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" propertiesProperty := &PropertiesProperty{ DnsProperties: &PublicDnsPropertiesMutableProperty{ Soa: &SOAProperty{ Ttl: jsii.Number(123), }, }, }
type CfnPublicDnsNamespace_PublicDnsPropertiesMutableProperty ¶
type CfnPublicDnsNamespace_PublicDnsPropertiesMutableProperty struct { // Start of Authority (SOA) record for the hosted zone for the public DNS namespace. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-servicediscovery-publicdnsnamespace-publicdnspropertiesmutable.html#cfn-servicediscovery-publicdnsnamespace-publicdnspropertiesmutable-soa // Soa interface{} `field:"optional" json:"soa" yaml:"soa"` }
DNS properties for the public DNS namespace.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" publicDnsPropertiesMutableProperty := &PublicDnsPropertiesMutableProperty{ Soa: &SOAProperty{ Ttl: jsii.Number(123), }, }
type CfnPublicDnsNamespace_SOAProperty ¶
type CfnPublicDnsNamespace_SOAProperty struct { // The time to live (TTL) for purposes of negative caching. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-servicediscovery-publicdnsnamespace-soa.html#cfn-servicediscovery-publicdnsnamespace-soa-ttl // Ttl *float64 `field:"optional" json:"ttl" yaml:"ttl"` }
Start of Authority (SOA) properties for a public or private DNS namespace.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" sOAProperty := &SOAProperty{ Ttl: jsii.Number(123), }
type CfnService ¶
type CfnService interface { awscdk.CfnResource awscdk.IInspectable awscdk.ITaggable // The Amazon Resource Name (ARN) of the service. AttrArn() *string // The ID of the service. AttrId() *string // The name that you assigned to the service. AttrName() *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 description of the service. Description() *string SetDescription(val *string) // A complex type that contains information about the Route 53 DNS records that you want AWS Cloud Map to create when you register an instance. DnsConfig() interface{} SetDnsConfig(val interface{}) // *Public DNS and HTTP namespaces only.* A complex type that contains settings for an optional health check. If you specify settings for a health check, AWS Cloud Map associates the health check with the records that you specify in `DnsConfig` . HealthCheckConfig() interface{} SetHealthCheckConfig(val interface{}) // A complex type that contains information about an optional custom health check. HealthCheckCustomConfig() interface{} SetHealthCheckCustomConfig(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 name of the service. Name() *string SetName(val *string) // The ID of the namespace that was used to create the service. NamespaceId() *string SetNamespaceId(val *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 // Tag Manager which manages the tags for this resource. Tags() awscdk.TagManager // The tags for the service. TagsRaw() *[]*awscdk.CfnTag SetTagsRaw(val *[]*awscdk.CfnTag) // If present, specifies that the service instances are only discoverable using the `DiscoverInstances` API operation. Type() *string SetType(val *string) // Deprecated. // Deprecated: use `updatedProperties` // // 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{} // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperties() *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. AddDependency(target awscdk.CfnResource) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // Deprecated: use addDependency. 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`). In some // cases, a snapshot can be taken of the resource prior to deletion // (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy // can be found in the following link:. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options // 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, typeHint awscdk.ResolutionTypeHint) 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) // Retrieves an array of resources this resource depends on. // // This assembles dependencies on resources across stacks (including nested stacks) // automatically. ObtainDependencies() *[]interface{} // Get a shallow copy of dependencies between this resource and other resources in the same stack. ObtainResourceDependencies() *[]awscdk.CfnResource // Overrides the auto-generated logical ID with a specific ID. OverrideLogicalId(newLogicalId *string) // Indicates that this resource no longer depends on another resource. // // This can be used for resources across stacks (including nested stacks) // and the dependency will automatically be removed from the relevant scope. RemoveDependency(target awscdk.CfnResource) RenderProperties(props *map[string]interface{}) *map[string]interface{} // Replaces one dependency with another. ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource) // 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 complex type that contains information about a service, which defines the configuration of the following entities:.
- For public and private DNS namespaces, one of the following combinations of DNS records in Amazon Route 53:
- A - AAAA - A and AAAA - SRV - CNAME - Optionally, a health check.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnService := awscdk.Aws_servicediscovery.NewCfnService(this, jsii.String("MyCfnService"), &CfnServiceProps{ Description: jsii.String("description"), DnsConfig: &DnsConfigProperty{ DnsRecords: []interface{}{ &DnsRecordProperty{ Ttl: jsii.Number(123), Type: jsii.String("type"), }, }, // the properties below are optional NamespaceId: jsii.String("namespaceId"), RoutingPolicy: jsii.String("routingPolicy"), }, HealthCheckConfig: &HealthCheckConfigProperty{ Type: jsii.String("type"), // the properties below are optional FailureThreshold: jsii.Number(123), ResourcePath: jsii.String("resourcePath"), }, HealthCheckCustomConfig: &HealthCheckCustomConfigProperty{ FailureThreshold: jsii.Number(123), }, Name: jsii.String("name"), NamespaceId: jsii.String("namespaceId"), Tags: []cfnTag{ &cfnTag{ Key: jsii.String("key"), Value: jsii.String("value"), }, }, Type: jsii.String("type"), })
func NewCfnService ¶
func NewCfnService(scope constructs.Construct, id *string, props *CfnServiceProps) CfnService
type CfnServiceProps ¶
type CfnServiceProps struct { // The description of the service. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicediscovery-service.html#cfn-servicediscovery-service-description // Description *string `field:"optional" json:"description" yaml:"description"` // A complex type that contains information about the Route 53 DNS records that you want AWS Cloud Map to create when you register an instance. // // > The record types of a service can only be changed by deleting the service and recreating it with a new `Dnsconfig` . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicediscovery-service.html#cfn-servicediscovery-service-dnsconfig // DnsConfig interface{} `field:"optional" json:"dnsConfig" yaml:"dnsConfig"` // *Public DNS and HTTP namespaces only.* A complex type that contains settings for an optional health check. If you specify settings for a health check, AWS Cloud Map associates the health check with the records that you specify in `DnsConfig` . // // For information about the charges for health checks, see [Amazon Route 53 Pricing](https://docs.aws.amazon.com/route53/pricing/) . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicediscovery-service.html#cfn-servicediscovery-service-healthcheckconfig // HealthCheckConfig interface{} `field:"optional" json:"healthCheckConfig" yaml:"healthCheckConfig"` // A complex type that contains information about an optional custom health check. // // > If you specify a health check configuration, you can specify either `HealthCheckCustomConfig` or `HealthCheckConfig` but not both. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicediscovery-service.html#cfn-servicediscovery-service-healthcheckcustomconfig // HealthCheckCustomConfig interface{} `field:"optional" json:"healthCheckCustomConfig" yaml:"healthCheckCustomConfig"` // The name of the service. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicediscovery-service.html#cfn-servicediscovery-service-name // Name *string `field:"optional" json:"name" yaml:"name"` // The ID of the namespace that was used to create the service. // // > You must specify a value for `NamespaceId` either for the service properties or for [DnsConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-servicediscovery-service-dnsconfig.html) . Don't specify a value in both places. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicediscovery-service.html#cfn-servicediscovery-service-namespaceid // NamespaceId *string `field:"optional" json:"namespaceId" yaml:"namespaceId"` // The tags for the service. // // Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicediscovery-service.html#cfn-servicediscovery-service-tags // Tags *[]*awscdk.CfnTag `field:"optional" json:"tags" yaml:"tags"` // If present, specifies that the service instances are only discoverable using the `DiscoverInstances` API operation. // // No DNS records is registered for the service instances. The only valid value is `HTTP` . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicediscovery-service.html#cfn-servicediscovery-service-type // Type *string `field:"optional" json:"type" yaml:"type"` }
Properties for defining a `CfnService`.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnServiceProps := &CfnServiceProps{ Description: jsii.String("description"), DnsConfig: &DnsConfigProperty{ DnsRecords: []interface{}{ &DnsRecordProperty{ Ttl: jsii.Number(123), Type: jsii.String("type"), }, }, // the properties below are optional NamespaceId: jsii.String("namespaceId"), RoutingPolicy: jsii.String("routingPolicy"), }, HealthCheckConfig: &HealthCheckConfigProperty{ Type: jsii.String("type"), // the properties below are optional FailureThreshold: jsii.Number(123), ResourcePath: jsii.String("resourcePath"), }, HealthCheckCustomConfig: &HealthCheckCustomConfigProperty{ FailureThreshold: jsii.Number(123), }, Name: jsii.String("name"), NamespaceId: jsii.String("namespaceId"), Tags: []cfnTag{ &cfnTag{ Key: jsii.String("key"), Value: jsii.String("value"), }, }, Type: jsii.String("type"), }
type CfnService_DnsConfigProperty ¶
type CfnService_DnsConfigProperty struct { // An array that contains one `DnsRecord` object for each Route 53 DNS record that you want AWS Cloud Map to create when you register an instance. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-servicediscovery-service-dnsconfig.html#cfn-servicediscovery-service-dnsconfig-dnsrecords // DnsRecords interface{} `field:"required" json:"dnsRecords" yaml:"dnsRecords"` // The ID of the namespace to use for DNS configuration. // // > You must specify a value for `NamespaceId` either for `DnsConfig` or for the [service properties](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicediscovery-service.html) . Don't specify a value in both places. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-servicediscovery-service-dnsconfig.html#cfn-servicediscovery-service-dnsconfig-namespaceid // NamespaceId *string `field:"optional" json:"namespaceId" yaml:"namespaceId"` // The routing policy that you want to apply to all Route 53 DNS records that AWS Cloud Map creates when you register an instance and specify this service. // // > If you want to use this service to register instances that create alias records, specify `WEIGHTED` for the routing policy. // // You can specify the following values: // // - **MULTIVALUE** - If you define a health check for the service and the health check is healthy, Route 53 returns the applicable value for up to eight instances. // // For example, suppose that the service includes configurations for one `A` record and a health check. You use the service to register 10 instances. Route 53 responds to DNS queries with IP addresses for up to eight healthy instances. If fewer than eight instances are healthy, Route 53 responds to every DNS query with the IP addresses for all of the healthy instances. // // If you don't define a health check for the service, Route 53 assumes that all instances are healthy and returns the values for up to eight instances. // // For more information about the multivalue routing policy, see [Multivalue Answer Routing](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy.html#routing-policy-multivalue) in the *Route 53 Developer Guide* . // - **WEIGHTED** - Route 53 returns the applicable value from one randomly selected instance from among the instances that you registered using the same service. Currently, all records have the same weight, so you can't route more or less traffic to any instances. // // For example, suppose that the service includes configurations for one `A` record and a health check. You use the service to register 10 instances. Route 53 responds to DNS queries with the IP address for one randomly selected instance from among the healthy instances. If no instances are healthy, Route 53 responds to DNS queries as if all of the instances were healthy. // // If you don't define a health check for the service, Route 53 assumes that all instances are healthy and returns the applicable value for one randomly selected instance. // // For more information about the weighted routing policy, see [Weighted Routing](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy.html#routing-policy-weighted) in the *Route 53 Developer Guide* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-servicediscovery-service-dnsconfig.html#cfn-servicediscovery-service-dnsconfig-routingpolicy // RoutingPolicy *string `field:"optional" json:"routingPolicy" yaml:"routingPolicy"` }
A complex type that contains information about the Amazon Route 53 DNS records that you want AWS Cloud Map to create when you register an instance.
> The record types of a service can only be changed by deleting the service and recreating it with a new `Dnsconfig` .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" dnsConfigProperty := &DnsConfigProperty{ DnsRecords: []interface{}{ &DnsRecordProperty{ Ttl: jsii.Number(123), Type: jsii.String("type"), }, }, // the properties below are optional NamespaceId: jsii.String("namespaceId"), RoutingPolicy: jsii.String("routingPolicy"), }
type CfnService_DnsRecordProperty ¶
type CfnService_DnsRecordProperty struct { // The amount of time, in seconds, that you want DNS resolvers to cache the settings for this record. // // > Alias records don't include a TTL because Route 53 uses the TTL for the AWS resource that an alias record routes traffic to. If you include the `AWS_ALIAS_DNS_NAME` attribute when you submit a [RegisterInstance](https://docs.aws.amazon.com/cloud-map/latest/api/API_RegisterInstance.html) request, the `TTL` value is ignored. Always specify a TTL for the service; you can use a service to register instances that create either alias or non-alias records. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-servicediscovery-service-dnsrecord.html#cfn-servicediscovery-service-dnsrecord-ttl // Ttl *float64 `field:"required" json:"ttl" yaml:"ttl"` // The type of the resource, which indicates the type of value that Route 53 returns in response to DNS queries. // // You can specify values for `Type` in the following combinations: // // - `A` // - `AAAA` // - `A` and `AAAA` // - `SRV` // - `CNAME` // // If you want AWS Cloud Map to create a Route 53 alias record when you register an instance, specify `A` or `AAAA` for `Type` . // // You specify other settings, such as the IP address for `A` and `AAAA` records, when you register an instance. For more information, see [RegisterInstance](https://docs.aws.amazon.com/cloud-map/latest/api/API_RegisterInstance.html) . // // The following values are supported: // // - **A** - Route 53 returns the IP address of the resource in IPv4 format, such as 192.0.2.44. // - **AAAA** - Route 53 returns the IP address of the resource in IPv6 format, such as 2001:0db8:85a3:0000:0000:abcd:0001:2345. // - **CNAME** - Route 53 returns the domain name of the resource, such as www.example.com. Note the following: // // - You specify the domain name that you want to route traffic to when you register an instance. For more information, see [Attributes](https://docs.aws.amazon.com/cloud-map/latest/api/API_RegisterInstance.html#cloudmap-RegisterInstance-request-Attributes) in the topic [RegisterInstance](https://docs.aws.amazon.com/cloud-map/latest/api/API_RegisterInstance.html) . // - You must specify `WEIGHTED` for the value of `RoutingPolicy` . // - You can't specify both `CNAME` for `Type` and settings for `HealthCheckConfig` . If you do, the request will fail with an `InvalidInput` error. // - **SRV** - Route 53 returns the value for an `SRV` record. The value for an `SRV` record uses the following values: // // `priority weight port service-hostname` // // Note the following about the values: // // - The values of `priority` and `weight` are both set to `1` and can't be changed. // - The value of `port` comes from the value that you specify for the `AWS_INSTANCE_PORT` attribute when you submit a [RegisterInstance](https://docs.aws.amazon.com/cloud-map/latest/api/API_RegisterInstance.html) request. // - The value of `service-hostname` is a concatenation of the following values: // // - The value that you specify for `InstanceId` when you register an instance. // - The name of the service. // - The name of the namespace. // // For example, if the value of `InstanceId` is `test` , the name of the service is `backend` , and the name of the namespace is `example.com` , the value of `service-hostname` is: // // `test.backend.example.com` // // If you specify settings for an `SRV` record and if you specify values for `AWS_INSTANCE_IPV4` , `AWS_INSTANCE_IPV6` , or both in the `RegisterInstance` request, AWS Cloud Map automatically creates `A` and/or `AAAA` records that have the same name as the value of `service-hostname` in the `SRV` record. You can ignore these records. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-servicediscovery-service-dnsrecord.html#cfn-servicediscovery-service-dnsrecord-type // Type *string `field:"required" json:"type" yaml:"type"` }
A complex type that contains information about the Route 53 DNS records that you want AWS Cloud Map to create when you register an instance.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" dnsRecordProperty := &DnsRecordProperty{ Ttl: jsii.Number(123), Type: jsii.String("type"), }
type CfnService_HealthCheckConfigProperty ¶
type CfnService_HealthCheckConfigProperty struct { // The type of health check that you want to create, which indicates how Route 53 determines whether an endpoint is healthy. // // > You can't change the value of `Type` after you create a health check. // // You can create the following types of health checks: // // - *HTTP* : Route 53 tries to establish a TCP connection. If successful, Route 53 submits an HTTP request and waits for an HTTP status code of 200 or greater and less than 400. // - *HTTPS* : Route 53 tries to establish a TCP connection. If successful, Route 53 submits an HTTPS request and waits for an HTTP status code of 200 or greater and less than 400. // // > If you specify HTTPS for the value of `Type` , the endpoint must support TLS v1.0 or later. // - *TCP* : Route 53 tries to establish a TCP connection. // // If you specify `TCP` for `Type` , don't specify a value for `ResourcePath` . // // For more information, see [How Route 53 Determines Whether an Endpoint Is Healthy](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-determining-health-of-endpoints.html) in the *Route 53 Developer Guide* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-servicediscovery-service-healthcheckconfig.html#cfn-servicediscovery-service-healthcheckconfig-type // Type *string `field:"required" json:"type" yaml:"type"` // The number of consecutive health checks that an endpoint must pass or fail for Route 53 to change the current status of the endpoint from unhealthy to healthy or the other way around. // // For more information, see [How Route 53 Determines Whether an Endpoint Is Healthy](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-determining-health-of-endpoints.html) in the *Route 53 Developer Guide* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-servicediscovery-service-healthcheckconfig.html#cfn-servicediscovery-service-healthcheckconfig-failurethreshold // FailureThreshold *float64 `field:"optional" json:"failureThreshold" yaml:"failureThreshold"` // The path that you want Route 53 to request when performing health checks. // // The path can be any value that your endpoint returns an HTTP status code of a 2xx or 3xx format for when the endpoint is healthy. An example file is `/docs/route53-health-check.html` . Route 53 automatically adds the DNS name for the service. If you don't specify a value for `ResourcePath` , the default value is `/` . // // If you specify `TCP` for `Type` , you must *not* specify a value for `ResourcePath` . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-servicediscovery-service-healthcheckconfig.html#cfn-servicediscovery-service-healthcheckconfig-resourcepath // ResourcePath *string `field:"optional" json:"resourcePath" yaml:"resourcePath"` }
*Public DNS and HTTP namespaces only.* A complex type that contains settings for an optional health check. If you specify settings for a health check, AWS Cloud Map associates the health check with the records that you specify in `DnsConfig` .
> If you specify a health check configuration, you can specify either `HealthCheckCustomConfig` or `HealthCheckConfig` but not both.
Health checks are basic Route 53 health checks that monitor an AWS endpoint. For information about pricing for health checks, see [Amazon Route 53 Pricing](https://docs.aws.amazon.com/route53/pricing/) .
Note the following about configuring health checks.
- **A and AAAA records** - If `DnsConfig` includes configurations for both `A` and `AAAA` records, AWS Cloud Map creates a health check that uses the IPv4 address to check the health of the resource. If the endpoint tthat's specified by the IPv4 address is unhealthy, Route 53 considers both the `A` and `AAAA` records to be unhealthy. - **CNAME records** - You can't specify settings for `HealthCheckConfig` when the `DNSConfig` includes `CNAME` for the value of `Type` . If you do, the `CreateService` request will fail with an `InvalidInput` error. - **Request interval** - A Route 53 health checker in each health-checking AWS Region sends a health check request to an endpoint every 30 seconds. On average, your endpoint receives a health check request about every two seconds. However, health checkers don't coordinate with one another. Therefore, you might sometimes see several requests in one second that's followed by a few seconds with no health checks at all. - **Health checking regions** - Health checkers perform checks from all Route 53 health-checking Regions. For a list of the current Regions, see [Regions](https://docs.aws.amazon.com/Route53/latest/APIReference/API_HealthCheckConfig.html#Route53-Type-HealthCheckConfig-Regions) . - **Alias records** - When you register an instance, if you include the `AWS_ALIAS_DNS_NAME` attribute, AWS Cloud Map creates a Route 53 alias record. Note the following:
- Route 53 automatically sets `EvaluateTargetHealth` to true for alias records. When `EvaluateTargetHealth` is true, the alias record inherits the health of the referenced AWS resource. such as an ELB load balancer. For more information, see [EvaluateTargetHealth](https://docs.aws.amazon.com/Route53/latest/APIReference/API_AliasTarget.html#Route53-Type-AliasTarget-EvaluateTargetHealth) . - If you include `HealthCheckConfig` and then use the service to register an instance that creates an alias record, Route 53 doesn't create the health check. - **Charges for health checks** - Health checks are basic Route 53 health checks that monitor an AWS endpoint. For information about pricing for health checks, see [Amazon Route 53 Pricing](https://docs.aws.amazon.com/route53/pricing/) .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" healthCheckConfigProperty := &HealthCheckConfigProperty{ Type: jsii.String("type"), // the properties below are optional FailureThreshold: jsii.Number(123), ResourcePath: jsii.String("resourcePath"), }
type CfnService_HealthCheckCustomConfigProperty ¶
type CfnService_HealthCheckCustomConfigProperty struct { // > This parameter is no longer supported and is always set to 1. // // AWS Cloud Map waits for approximately 30 seconds after receiving an `UpdateInstanceCustomHealthStatus` request before changing the status of the service instance. // // The number of 30-second intervals that you want AWS Cloud Map to wait after receiving an `UpdateInstanceCustomHealthStatus` request before it changes the health status of a service instance. // // Sending a second or subsequent `UpdateInstanceCustomHealthStatus` request with the same value before 30 seconds has passed doesn't accelerate the change. AWS Cloud Map still waits `30` seconds after the first request to make the change. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-servicediscovery-service-healthcheckcustomconfig.html#cfn-servicediscovery-service-healthcheckcustomconfig-failurethreshold // FailureThreshold *float64 `field:"optional" json:"failureThreshold" yaml:"failureThreshold"` }
A complex type that contains information about an optional custom health check.
A custom health check, which requires that you use a third-party health checker to evaluate the health of your resources, is useful in the following circumstances:
- You can't use a health check that's defined by `HealthCheckConfig` because the resource isn't available over the internet. For example, you can use a custom health check when the instance is in an Amazon VPC. (To check the health of resources in a VPC, the health checker must also be in the VPC.) - You want to use a third-party health checker regardless of where your resources are located.
> If you specify a health check configuration, you can specify either `HealthCheckCustomConfig` or `HealthCheckConfig` but not both.
To change the status of a custom health check, submit an `UpdateInstanceCustomHealthStatus` request. AWS Cloud Map doesn't monitor the status of the resource, it just keeps a record of the status specified in the most recent `UpdateInstanceCustomHealthStatus` request.
Here's how custom health checks work:
- You create a service. - You register an instance. - You configure a third-party health checker to monitor the resource that's associated with the new instance.
> AWS Cloud Map doesn't check the health of the resource directly. - The third-party health-checker determines that the resource is unhealthy and notifies your application. - Your application submits an `UpdateInstanceCustomHealthStatus` request. - AWS Cloud Map waits for 30 seconds. - If another `UpdateInstanceCustomHealthStatus` request doesn't arrive during that time to change the status back to healthy, AWS Cloud Map stops routing traffic to the resource.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" healthCheckCustomConfigProperty := &HealthCheckCustomConfigProperty{ FailureThreshold: jsii.Number(123), }
type CnameInstance ¶
type CnameInstance interface { InstanceBase // The domain name returned by DNS queries for the instance. Cname() *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 Id of the instance. InstanceId() *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 Cloudmap service to which the instance is registered. Service() IService // 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 // Generate a unique instance Id that is safe to pass to CloudMap. UniqueInstanceId() *string }
Instance that is accessible using a domain name (CNAME).
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" var service service cnameInstance := awscdk.Aws_servicediscovery.NewCnameInstance(this, jsii.String("MyCnameInstance"), &CnameInstanceProps{ InstanceCname: jsii.String("instanceCname"), Service: service, // the properties below are optional CustomAttributes: map[string]*string{ "customAttributesKey": jsii.String("customAttributes"), }, InstanceId: jsii.String("instanceId"), })
func NewCnameInstance ¶
func NewCnameInstance(scope constructs.Construct, id *string, props *CnameInstanceProps) CnameInstance
type CnameInstanceBaseProps ¶
type CnameInstanceBaseProps struct { // Custom attributes of the instance. // Default: none. // CustomAttributes *map[string]*string `field:"optional" json:"customAttributes" yaml:"customAttributes"` // The id of the instance resource. // Default: Automatically generated name. // InstanceId *string `field:"optional" json:"instanceId" yaml:"instanceId"` // If the service configuration includes a CNAME record, the domain name that you want Route 53 to return in response to DNS queries, for example, example.com. This value is required if the service specified by ServiceId includes settings for an CNAME record. InstanceCname *string `field:"required" json:"instanceCname" yaml:"instanceCname"` }
Example:
import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" app := cdk.NewApp() stack := cdk.NewStack(app, jsii.String("aws-servicediscovery-integ")) namespace := servicediscovery.NewPublicDnsNamespace(stack, jsii.String("Namespace"), &PublicDnsNamespaceProps{ Name: jsii.String("foobar.com"), }) service := namespace.CreateService(jsii.String("Service"), &DnsServiceProps{ Name: jsii.String("foo"), DnsRecordType: servicediscovery.DnsRecordType_CNAME, DnsTtl: cdk.Duration_Seconds(jsii.Number(30)), }) service.RegisterCnameInstance(jsii.String("CnameInstance"), &CnameInstanceBaseProps{ InstanceCname: jsii.String("service.pizza"), }) app.Synth()
type CnameInstanceProps ¶
type CnameInstanceProps struct { // Custom attributes of the instance. // Default: none. // CustomAttributes *map[string]*string `field:"optional" json:"customAttributes" yaml:"customAttributes"` // The id of the instance resource. // Default: Automatically generated name. // InstanceId *string `field:"optional" json:"instanceId" yaml:"instanceId"` // If the service configuration includes a CNAME record, the domain name that you want Route 53 to return in response to DNS queries, for example, example.com. This value is required if the service specified by ServiceId includes settings for an CNAME record. InstanceCname *string `field:"required" json:"instanceCname" yaml:"instanceCname"` // The Cloudmap service this resource is registered to. Service IService `field:"required" json:"service" yaml:"service"` }
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" var service service cnameInstanceProps := &CnameInstanceProps{ InstanceCname: jsii.String("instanceCname"), Service: service, // the properties below are optional CustomAttributes: map[string]*string{ "customAttributesKey": jsii.String("customAttributes"), }, InstanceId: jsii.String("instanceId"), }
type DiscoveryType ¶ added in v2.38.0
type DiscoveryType string
Specifies information about the discovery type of a service.
Example:
import ec2 "github.com/aws/aws-cdk-go/awscdk" import elbv2 "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" app := cdk.NewApp() stack := cdk.NewStack(app, jsii.String("aws-servicediscovery-integ")) vpc := ec2.NewVpc(stack, jsii.String("Vpc"), &VpcProps{ MaxAzs: jsii.Number(2), }) namespace := servicediscovery.NewPrivateDnsNamespace(stack, jsii.String("Namespace"), &PrivateDnsNamespaceProps{ Name: jsii.String("boobar.com"), Vpc: Vpc, }) service := namespace.CreateService(jsii.String("Service"), &DnsServiceProps{ DnsRecordType: servicediscovery.DnsRecordType_A_AAAA, DnsTtl: cdk.Duration_Seconds(jsii.Number(30)), LoadBalancer: jsii.Boolean(true), }) loadbalancer := elbv2.NewApplicationLoadBalancer(stack, jsii.String("LB"), &ApplicationLoadBalancerProps{ Vpc: Vpc, InternetFacing: jsii.Boolean(true), }) service.RegisterLoadBalancer(jsii.String("Loadbalancer"), loadbalancer) arnService := namespace.CreateService(jsii.String("ArnService"), &DnsServiceProps{ DiscoveryType: servicediscovery.DiscoveryType_API, }) arnService.RegisterNonIpInstance(jsii.String("NonIpInstance"), &NonIpInstanceBaseProps{ CustomAttributes: map[string]*string{ "arn": jsii.String("arn://"), }, }) app.Synth()
const ( // Instances are discoverable via API only. DiscoveryType_API DiscoveryType = "API" // Instances are discoverable via DNS or API. DiscoveryType_DNS_AND_API DiscoveryType = "DNS_AND_API" )
type DnsRecordType ¶
type DnsRecordType string
Example:
import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" app := cdk.NewApp() stack := cdk.NewStack(app, jsii.String("aws-servicediscovery-integ")) namespace := servicediscovery.NewPublicDnsNamespace(stack, jsii.String("Namespace"), &PublicDnsNamespaceProps{ Name: jsii.String("foobar.com"), }) service := namespace.CreateService(jsii.String("Service"), &DnsServiceProps{ Name: jsii.String("foo"), DnsRecordType: servicediscovery.DnsRecordType_CNAME, DnsTtl: cdk.Duration_Seconds(jsii.Number(30)), }) service.RegisterCnameInstance(jsii.String("CnameInstance"), &CnameInstanceBaseProps{ InstanceCname: jsii.String("service.pizza"), }) app.Synth()
const ( // An A record. DnsRecordType_A DnsRecordType = "A" // An AAAA record. DnsRecordType_AAAA DnsRecordType = "AAAA" // Both an A and AAAA record. DnsRecordType_A_AAAA DnsRecordType = "A_AAAA" // A Srv record. DnsRecordType_SRV DnsRecordType = "SRV" // A CNAME record. DnsRecordType_CNAME DnsRecordType = "CNAME" )
type DnsServiceProps ¶
type DnsServiceProps struct { // Structure containing failure threshold for a custom health checker. // // Only one of healthCheckConfig or healthCheckCustomConfig can be specified. // See: https://docs.aws.amazon.com/cloud-map/latest/api/API_HealthCheckCustomConfig.html // Default: none. // CustomHealthCheck *HealthCheckCustomConfig `field:"optional" json:"customHealthCheck" yaml:"customHealthCheck"` // A description of the service. // Default: none. // Description *string `field:"optional" json:"description" yaml:"description"` // Settings for an optional health check. // // If you specify health check settings, AWS Cloud Map associates the health // check with the records that you specify in DnsConfig. Only one of healthCheckConfig or healthCheckCustomConfig can // be specified. Not valid for PrivateDnsNamespaces. If you use healthCheck, you can only register IP instances to // this service. // Default: none. // HealthCheck *HealthCheckConfig `field:"optional" json:"healthCheck" yaml:"healthCheck"` // A name for the Service. // Default: CloudFormation-generated name. // Name *string `field:"optional" json:"name" yaml:"name"` // Controls how instances within this service can be discovered. // Default: DNS_AND_API. // DiscoveryType DiscoveryType `field:"optional" json:"discoveryType" yaml:"discoveryType"` // The DNS type of the record that you want AWS Cloud Map to create. // // Supported record types // include A, AAAA, A and AAAA (A_AAAA), CNAME, and SRV. // Default: A. // DnsRecordType DnsRecordType `field:"optional" json:"dnsRecordType" yaml:"dnsRecordType"` // The amount of time, in seconds, that you want DNS resolvers to cache the settings for this record. // Default: Duration.minutes(1) // DnsTtl awscdk.Duration `field:"optional" json:"dnsTtl" yaml:"dnsTtl"` // Whether or not this service will have an Elastic LoadBalancer registered to it as an AliasTargetInstance. // // Setting this to `true` correctly configures the `routingPolicy` // and performs some additional validation. // Default: false. // LoadBalancer *bool `field:"optional" json:"loadBalancer" yaml:"loadBalancer"` // The routing policy that you want to apply to all DNS records that AWS Cloud Map creates when you register an instance and specify this service. // Default: WEIGHTED for CNAME records and when loadBalancer is true, MULTIVALUE otherwise. // RoutingPolicy RoutingPolicy `field:"optional" json:"routingPolicy" yaml:"routingPolicy"` }
Service props needed to create a service in a given namespace.
Used by createService() for PrivateDnsNamespace and PublicDnsNamespace.
Example:
import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" app := cdk.NewApp() stack := cdk.NewStack(app, jsii.String("aws-servicediscovery-integ")) namespace := servicediscovery.NewPublicDnsNamespace(stack, jsii.String("Namespace"), &PublicDnsNamespaceProps{ Name: jsii.String("foobar.com"), }) service := namespace.CreateService(jsii.String("Service"), &DnsServiceProps{ Name: jsii.String("foo"), DnsRecordType: servicediscovery.DnsRecordType_A, DnsTtl: cdk.Duration_Seconds(jsii.Number(30)), HealthCheck: &HealthCheckConfig{ Type: servicediscovery.HealthCheckType_HTTPS, ResourcePath: jsii.String("/healthcheck"), FailureThreshold: jsii.Number(2), }, }) service.RegisterIpInstance(jsii.String("IpInstance"), &IpInstanceBaseProps{ Ipv4: jsii.String("54.239.25.192"), Port: jsii.Number(443), }) app.Synth()
type HealthCheckConfig ¶
type HealthCheckConfig struct { // The number of consecutive health checks that an endpoint must pass or fail for Route 53 to change the current status of the endpoint from unhealthy to healthy or vice versa. // Default: 1. // FailureThreshold *float64 `field:"optional" json:"failureThreshold" yaml:"failureThreshold"` // The path that you want Route 53 to request when performing health checks. // // Do not use when health check type is TCP. // Default: '/'. // ResourcePath *string `field:"optional" json:"resourcePath" yaml:"resourcePath"` // The type of health check that you want to create, which indicates how Route 53 determines whether an endpoint is healthy. // // Cannot be modified once created. Supported values are HTTP, HTTPS, and TCP. // Default: HTTP. // Type HealthCheckType `field:"optional" json:"type" yaml:"type"` }
Settings for an optional Amazon Route 53 health check.
If you specify settings for a health check, AWS Cloud Map associates the health check with all the records that you specify in DnsConfig. Only valid with a PublicDnsNamespace.
Example:
import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" app := cdk.NewApp() stack := cdk.NewStack(app, jsii.String("aws-servicediscovery-integ")) namespace := servicediscovery.NewHttpNamespace(stack, jsii.String("MyNamespace"), &HttpNamespaceProps{ Name: jsii.String("MyHTTPNamespace"), }) service1 := namespace.CreateService(jsii.String("NonIpService"), &BaseServiceProps{ Description: jsii.String("service registering non-ip instances"), }) service1.RegisterNonIpInstance(jsii.String("NonIpInstance"), &NonIpInstanceBaseProps{ CustomAttributes: map[string]*string{ "arn": jsii.String("arn:aws:s3:::mybucket"), }, }) service2 := namespace.CreateService(jsii.String("IpService"), &BaseServiceProps{ Description: jsii.String("service registering ip instances"), HealthCheck: &HealthCheckConfig{ Type: servicediscovery.HealthCheckType_HTTP, ResourcePath: jsii.String("/check"), }, }) service2.RegisterIpInstance(jsii.String("IpInstance"), &IpInstanceBaseProps{ Ipv4: jsii.String("54.239.25.192"), }) app.Synth()
type HealthCheckCustomConfig ¶
type HealthCheckCustomConfig struct { // The number of 30-second intervals that you want Cloud Map to wait after receiving an UpdateInstanceCustomHealthStatus request before it changes the health status of a service instance. // Default: 1. // FailureThreshold *float64 `field:"optional" json:"failureThreshold" yaml:"failureThreshold"` }
Specifies information about an optional custom health check.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" healthCheckCustomConfig := &HealthCheckCustomConfig{ FailureThreshold: jsii.Number(123), }
type HealthCheckType ¶
type HealthCheckType string
Example:
import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" app := cdk.NewApp() stack := cdk.NewStack(app, jsii.String("aws-servicediscovery-integ")) namespace := servicediscovery.NewHttpNamespace(stack, jsii.String("MyNamespace"), &HttpNamespaceProps{ Name: jsii.String("MyHTTPNamespace"), }) service1 := namespace.CreateService(jsii.String("NonIpService"), &BaseServiceProps{ Description: jsii.String("service registering non-ip instances"), }) service1.RegisterNonIpInstance(jsii.String("NonIpInstance"), &NonIpInstanceBaseProps{ CustomAttributes: map[string]*string{ "arn": jsii.String("arn:aws:s3:::mybucket"), }, }) service2 := namespace.CreateService(jsii.String("IpService"), &BaseServiceProps{ Description: jsii.String("service registering ip instances"), HealthCheck: &HealthCheckConfig{ Type: servicediscovery.HealthCheckType_HTTP, ResourcePath: jsii.String("/check"), }, }) service2.RegisterIpInstance(jsii.String("IpInstance"), &IpInstanceBaseProps{ Ipv4: jsii.String("54.239.25.192"), }) app.Synth()
const ( // Route 53 tries to establish a TCP connection. // // If successful, Route 53 submits an HTTP request and waits for an HTTP // status code of 200 or greater and less than 400. HealthCheckType_HTTP HealthCheckType = "HTTP" // Route 53 tries to establish a TCP connection. // // If successful, Route 53 submits an HTTPS request and waits for an // HTTP status code of 200 or greater and less than 400. If you specify HTTPS for the value of Type, the endpoint // must support TLS v1.0 or later. HealthCheckType_HTTPS HealthCheckType = "HTTPS" // Route 53 tries to establish a TCP connection. // // If you specify TCP for Type, don't specify a value for ResourcePath. HealthCheckType_TCP HealthCheckType = "TCP" )
type HttpNamespace ¶
type HttpNamespace interface { awscdk.Resource IHttpNamespace // 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 HttpNamespaceArn() *string HttpNamespaceId() *string HttpNamespaceName() *string // Namespace Arn for the namespace. NamespaceArn() *string // Namespace Id for the namespace. NamespaceId() *string // A name for the namespace. NamespaceName() *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 // Type of the namespace. Type() NamespaceType // 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) // Creates a service within the namespace. CreateService(id *string, props *BaseServiceProps) Service 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 }
Define an HTTP Namespace.
Example:
import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" app := cdk.NewApp() stack := cdk.NewStack(app, jsii.String("aws-servicediscovery-integ")) namespace := servicediscovery.NewHttpNamespace(stack, jsii.String("MyNamespace"), &HttpNamespaceProps{ Name: jsii.String("MyHTTPNamespace"), }) service1 := namespace.CreateService(jsii.String("NonIpService"), &BaseServiceProps{ Description: jsii.String("service registering non-ip instances"), }) service1.RegisterNonIpInstance(jsii.String("NonIpInstance"), &NonIpInstanceBaseProps{ CustomAttributes: map[string]*string{ "arn": jsii.String("arn:aws:s3:::mybucket"), }, }) service2 := namespace.CreateService(jsii.String("IpService"), &BaseServiceProps{ Description: jsii.String("service registering ip instances"), HealthCheck: &HealthCheckConfig{ Type: servicediscovery.HealthCheckType_HTTP, ResourcePath: jsii.String("/check"), }, }) service2.RegisterIpInstance(jsii.String("IpInstance"), &IpInstanceBaseProps{ Ipv4: jsii.String("54.239.25.192"), }) app.Synth()
func NewHttpNamespace ¶
func NewHttpNamespace(scope constructs.Construct, id *string, props *HttpNamespaceProps) HttpNamespace
type HttpNamespaceAttributes ¶
type HttpNamespaceAttributes struct { // Namespace ARN for the Namespace. NamespaceArn *string `field:"required" json:"namespaceArn" yaml:"namespaceArn"` // Namespace Id for the Namespace. NamespaceId *string `field:"required" json:"namespaceId" yaml:"namespaceId"` // A name for the Namespace. NamespaceName *string `field:"required" json:"namespaceName" yaml:"namespaceName"` }
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" httpNamespaceAttributes := &HttpNamespaceAttributes{ NamespaceArn: jsii.String("namespaceArn"), NamespaceId: jsii.String("namespaceId"), NamespaceName: jsii.String("namespaceName"), }
type HttpNamespaceProps ¶
type HttpNamespaceProps struct { // A name for the Namespace. Name *string `field:"required" json:"name" yaml:"name"` // A description of the Namespace. // Default: none. // Description *string `field:"optional" json:"description" yaml:"description"` }
Example:
import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" app := cdk.NewApp() stack := cdk.NewStack(app, jsii.String("aws-servicediscovery-integ")) namespace := servicediscovery.NewHttpNamespace(stack, jsii.String("MyNamespace"), &HttpNamespaceProps{ Name: jsii.String("MyHTTPNamespace"), }) service1 := namespace.CreateService(jsii.String("NonIpService"), &BaseServiceProps{ Description: jsii.String("service registering non-ip instances"), }) service1.RegisterNonIpInstance(jsii.String("NonIpInstance"), &NonIpInstanceBaseProps{ CustomAttributes: map[string]*string{ "arn": jsii.String("arn:aws:s3:::mybucket"), }, }) service2 := namespace.CreateService(jsii.String("IpService"), &BaseServiceProps{ Description: jsii.String("service registering ip instances"), HealthCheck: &HealthCheckConfig{ Type: servicediscovery.HealthCheckType_HTTP, ResourcePath: jsii.String("/check"), }, }) service2.RegisterIpInstance(jsii.String("IpInstance"), &IpInstanceBaseProps{ Ipv4: jsii.String("54.239.25.192"), }) app.Synth()
type IHttpNamespace ¶
type IHttpNamespace interface { INamespace }
func HttpNamespace_FromHttpNamespaceAttributes ¶
func HttpNamespace_FromHttpNamespaceAttributes(scope constructs.Construct, id *string, attrs *HttpNamespaceAttributes) IHttpNamespace
type INamespace ¶
type INamespace interface { awscdk.IResource // Namespace ARN for the Namespace. NamespaceArn() *string // Namespace Id for the Namespace. NamespaceId() *string // A name for the Namespace. NamespaceName() *string // Type of Namespace. Type() NamespaceType }
type IPrivateDnsNamespace ¶
type IPrivateDnsNamespace interface { INamespace }
func PrivateDnsNamespace_FromPrivateDnsNamespaceAttributes ¶
func PrivateDnsNamespace_FromPrivateDnsNamespaceAttributes(scope constructs.Construct, id *string, attrs *PrivateDnsNamespaceAttributes) IPrivateDnsNamespace
type IPublicDnsNamespace ¶
type IPublicDnsNamespace interface { INamespace }
func PublicDnsNamespace_FromPublicDnsNamespaceAttributes ¶
func PublicDnsNamespace_FromPublicDnsNamespaceAttributes(scope constructs.Construct, id *string, attrs *PublicDnsNamespaceAttributes) IPublicDnsNamespace
type IService ¶
type IService interface { awscdk.IResource // The discovery type used by the service. DiscoveryType() DiscoveryType // The DnsRecordType used by the service. DnsRecordType() DnsRecordType // The namespace for the Cloudmap Service. Namespace() INamespace // The Routing Policy used by the service. RoutingPolicy() RoutingPolicy // The Arn of the namespace that you want to use for DNS configuration. ServiceArn() *string // The ID of the namespace that you want to use for DNS configuration. ServiceId() *string // A name for the Cloudmap Service. ServiceName() *string }
func Service_FromServiceAttributes ¶
func Service_FromServiceAttributes(scope constructs.Construct, id *string, attrs *ServiceAttributes) IService
type InstanceBase ¶
type InstanceBase interface { awscdk.Resource IInstance // 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 Id of the instance. InstanceId() *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 Cloudmap service to which the instance is registered. Service() IService // 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 // Generate a unique instance Id that is safe to pass to CloudMap. UniqueInstanceId() *string }
type IpInstance ¶
type IpInstance interface { InstanceBase // 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 Id of the instance. InstanceId() *string // The Ipv4 address of the instance, or blank string if none available. Ipv4() *string // The Ipv6 address of the instance, or blank string if none available. Ipv6() *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 exposed port of the instance. Port() *float64 // The Cloudmap service to which the instance is registered. Service() IService // 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 // Generate a unique instance Id that is safe to pass to CloudMap. UniqueInstanceId() *string }
Instance that is accessible using an IP address.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" var service service ipInstance := awscdk.Aws_servicediscovery.NewIpInstance(this, jsii.String("MyIpInstance"), &IpInstanceProps{ Service: service, // the properties below are optional CustomAttributes: map[string]*string{ "customAttributesKey": jsii.String("customAttributes"), }, InstanceId: jsii.String("instanceId"), Ipv4: jsii.String("ipv4"), Ipv6: jsii.String("ipv6"), Port: jsii.Number(123), })
func NewIpInstance ¶
func NewIpInstance(scope constructs.Construct, id *string, props *IpInstanceProps) IpInstance
type IpInstanceBaseProps ¶
type IpInstanceBaseProps struct { // Custom attributes of the instance. // Default: none. // CustomAttributes *map[string]*string `field:"optional" json:"customAttributes" yaml:"customAttributes"` // The id of the instance resource. // Default: Automatically generated name. // InstanceId *string `field:"optional" json:"instanceId" yaml:"instanceId"` // If the service that you specify contains a template for an A record, the IPv4 address that you want AWS Cloud Map to use for the value of the A record. // Default: none. // Ipv4 *string `field:"optional" json:"ipv4" yaml:"ipv4"` // If the service that you specify contains a template for an AAAA record, the IPv6 address that you want AWS Cloud Map to use for the value of the AAAA record. // Default: none. // Ipv6 *string `field:"optional" json:"ipv6" yaml:"ipv6"` // The port on the endpoint that you want AWS Cloud Map to perform health checks on. // // This value is also used for // the port value in an SRV record if the service that you specify includes an SRV record. You can also specify a // default port that is applied to all instances in the Service configuration. // Default: 80. // Port *float64 `field:"optional" json:"port" yaml:"port"` }
Example:
import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" app := cdk.NewApp() stack := cdk.NewStack(app, jsii.String("aws-servicediscovery-integ")) namespace := servicediscovery.NewHttpNamespace(stack, jsii.String("MyNamespace"), &HttpNamespaceProps{ Name: jsii.String("MyHTTPNamespace"), }) service1 := namespace.CreateService(jsii.String("NonIpService"), &BaseServiceProps{ Description: jsii.String("service registering non-ip instances"), }) service1.RegisterNonIpInstance(jsii.String("NonIpInstance"), &NonIpInstanceBaseProps{ CustomAttributes: map[string]*string{ "arn": jsii.String("arn:aws:s3:::mybucket"), }, }) service2 := namespace.CreateService(jsii.String("IpService"), &BaseServiceProps{ Description: jsii.String("service registering ip instances"), HealthCheck: &HealthCheckConfig{ Type: servicediscovery.HealthCheckType_HTTP, ResourcePath: jsii.String("/check"), }, }) service2.RegisterIpInstance(jsii.String("IpInstance"), &IpInstanceBaseProps{ Ipv4: jsii.String("54.239.25.192"), }) app.Synth()
type IpInstanceProps ¶
type IpInstanceProps struct { // Custom attributes of the instance. // Default: none. // CustomAttributes *map[string]*string `field:"optional" json:"customAttributes" yaml:"customAttributes"` // The id of the instance resource. // Default: Automatically generated name. // InstanceId *string `field:"optional" json:"instanceId" yaml:"instanceId"` // If the service that you specify contains a template for an A record, the IPv4 address that you want AWS Cloud Map to use for the value of the A record. // Default: none. // Ipv4 *string `field:"optional" json:"ipv4" yaml:"ipv4"` // If the service that you specify contains a template for an AAAA record, the IPv6 address that you want AWS Cloud Map to use for the value of the AAAA record. // Default: none. // Ipv6 *string `field:"optional" json:"ipv6" yaml:"ipv6"` // The port on the endpoint that you want AWS Cloud Map to perform health checks on. // // This value is also used for // the port value in an SRV record if the service that you specify includes an SRV record. You can also specify a // default port that is applied to all instances in the Service configuration. // Default: 80. // Port *float64 `field:"optional" json:"port" yaml:"port"` // The Cloudmap service this resource is registered to. Service IService `field:"required" json:"service" yaml:"service"` }
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" var service service ipInstanceProps := &IpInstanceProps{ Service: service, // the properties below are optional CustomAttributes: map[string]*string{ "customAttributesKey": jsii.String("customAttributes"), }, InstanceId: jsii.String("instanceId"), Ipv4: jsii.String("ipv4"), Ipv6: jsii.String("ipv6"), Port: jsii.Number(123), }
type NamespaceType ¶
type NamespaceType string
const ( // Choose this option if you want your application to use only API calls to discover registered instances. NamespaceType_HTTP NamespaceType = "HTTP" // Choose this option if you want your application to be able to discover instances using either API calls or using DNS queries in a VPC. NamespaceType_DNS_PRIVATE NamespaceType = "DNS_PRIVATE" // Choose this option if you want your application to be able to discover instances using either API calls or using public DNS queries. // // You aren't required to use both methods. NamespaceType_DNS_PUBLIC NamespaceType = "DNS_PUBLIC" )
type NonIpInstance ¶
type NonIpInstance interface { InstanceBase // 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 Id of the instance. InstanceId() *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 Cloudmap service to which the instance is registered. Service() IService // 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 // Generate a unique instance Id that is safe to pass to CloudMap. UniqueInstanceId() *string }
Instance accessible using values other than an IP address or a domain name (CNAME).
Specify the other values in Custom attributes.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" var service service nonIpInstance := awscdk.Aws_servicediscovery.NewNonIpInstance(this, jsii.String("MyNonIpInstance"), &NonIpInstanceProps{ Service: service, // the properties below are optional CustomAttributes: map[string]*string{ "customAttributesKey": jsii.String("customAttributes"), }, InstanceId: jsii.String("instanceId"), })
func NewNonIpInstance ¶
func NewNonIpInstance(scope constructs.Construct, id *string, props *NonIpInstanceProps) NonIpInstance
type NonIpInstanceBaseProps ¶
type NonIpInstanceBaseProps struct { // Custom attributes of the instance. // Default: none. // CustomAttributes *map[string]*string `field:"optional" json:"customAttributes" yaml:"customAttributes"` // The id of the instance resource. // Default: Automatically generated name. // InstanceId *string `field:"optional" json:"instanceId" yaml:"instanceId"` }
Example:
import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" app := cdk.NewApp() stack := cdk.NewStack(app, jsii.String("aws-servicediscovery-integ")) namespace := servicediscovery.NewHttpNamespace(stack, jsii.String("MyNamespace"), &HttpNamespaceProps{ Name: jsii.String("MyHTTPNamespace"), }) service1 := namespace.CreateService(jsii.String("NonIpService"), &BaseServiceProps{ Description: jsii.String("service registering non-ip instances"), }) service1.RegisterNonIpInstance(jsii.String("NonIpInstance"), &NonIpInstanceBaseProps{ CustomAttributes: map[string]*string{ "arn": jsii.String("arn:aws:s3:::mybucket"), }, }) service2 := namespace.CreateService(jsii.String("IpService"), &BaseServiceProps{ Description: jsii.String("service registering ip instances"), HealthCheck: &HealthCheckConfig{ Type: servicediscovery.HealthCheckType_HTTP, ResourcePath: jsii.String("/check"), }, }) service2.RegisterIpInstance(jsii.String("IpInstance"), &IpInstanceBaseProps{ Ipv4: jsii.String("54.239.25.192"), }) app.Synth()
type NonIpInstanceProps ¶
type NonIpInstanceProps struct { // Custom attributes of the instance. // Default: none. // CustomAttributes *map[string]*string `field:"optional" json:"customAttributes" yaml:"customAttributes"` // The id of the instance resource. // Default: Automatically generated name. // InstanceId *string `field:"optional" json:"instanceId" yaml:"instanceId"` // The Cloudmap service this resource is registered to. Service IService `field:"required" json:"service" yaml:"service"` }
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" var service service nonIpInstanceProps := &NonIpInstanceProps{ Service: service, // the properties below are optional CustomAttributes: map[string]*string{ "customAttributesKey": jsii.String("customAttributes"), }, InstanceId: jsii.String("instanceId"), }
type PrivateDnsNamespace ¶
type PrivateDnsNamespace interface { awscdk.Resource IPrivateDnsNamespace // 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 // Namespace Arn of the namespace. NamespaceArn() *string // ID of hosted zone created by namespace. NamespaceHostedZoneId() *string // Namespace Id of the PrivateDnsNamespace. NamespaceId() *string // The name of the PrivateDnsNamespace. NamespaceName() *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 PrivateDnsNamespaceArn() *string PrivateDnsNamespaceId() *string PrivateDnsNamespaceName() *string // The stack in which this resource is defined. Stack() awscdk.Stack // Type of the namespace. Type() NamespaceType // 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) // Creates a service within the namespace. CreateService(id *string, props *DnsServiceProps) Service 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 }
Define a Service Discovery HTTP Namespace.
Example:
var mesh mesh // Cloud Map service discovery is currently required for host ejection by outlier detection vpc := ec2.NewVpc(this, jsii.String("vpc")) namespace := cloudmap.NewPrivateDnsNamespace(this, jsii.String("test-namespace"), &PrivateDnsNamespaceProps{ Vpc: Vpc, Name: jsii.String("domain.local"), }) service := namespace.CreateService(jsii.String("Svc")) node := mesh.addVirtualNode(jsii.String("virtual-node"), &VirtualNodeBaseProps{ ServiceDiscovery: appmesh.ServiceDiscovery_CloudMap(service), Listeners: []virtualNodeListener{ appmesh.*virtualNodeListener_Http(&HttpVirtualNodeListenerOptions{ OutlierDetection: &OutlierDetection{ BaseEjectionDuration: awscdk.Duration_Seconds(jsii.Number(10)), Interval: awscdk.Duration_*Seconds(jsii.Number(30)), MaxEjectionPercent: jsii.Number(50), MaxServerErrors: jsii.Number(5), }, }), }, })
func NewPrivateDnsNamespace ¶
func NewPrivateDnsNamespace(scope constructs.Construct, id *string, props *PrivateDnsNamespaceProps) PrivateDnsNamespace
type PrivateDnsNamespaceAttributes ¶
type PrivateDnsNamespaceAttributes struct { // Namespace ARN for the Namespace. NamespaceArn *string `field:"required" json:"namespaceArn" yaml:"namespaceArn"` // Namespace Id for the Namespace. NamespaceId *string `field:"required" json:"namespaceId" yaml:"namespaceId"` // A name for the Namespace. NamespaceName *string `field:"required" json:"namespaceName" yaml:"namespaceName"` }
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" privateDnsNamespaceAttributes := &PrivateDnsNamespaceAttributes{ NamespaceArn: jsii.String("namespaceArn"), NamespaceId: jsii.String("namespaceId"), NamespaceName: jsii.String("namespaceName"), }
type PrivateDnsNamespaceProps ¶
type PrivateDnsNamespaceProps struct { // A name for the Namespace. Name *string `field:"required" json:"name" yaml:"name"` // A description of the Namespace. // Default: none. // Description *string `field:"optional" json:"description" yaml:"description"` // The Amazon VPC that you want to associate the namespace with. Vpc awsec2.IVpc `field:"required" json:"vpc" yaml:"vpc"` }
Example:
var mesh mesh // Cloud Map service discovery is currently required for host ejection by outlier detection vpc := ec2.NewVpc(this, jsii.String("vpc")) namespace := cloudmap.NewPrivateDnsNamespace(this, jsii.String("test-namespace"), &PrivateDnsNamespaceProps{ Vpc: Vpc, Name: jsii.String("domain.local"), }) service := namespace.CreateService(jsii.String("Svc")) node := mesh.addVirtualNode(jsii.String("virtual-node"), &VirtualNodeBaseProps{ ServiceDiscovery: appmesh.ServiceDiscovery_CloudMap(service), Listeners: []virtualNodeListener{ appmesh.*virtualNodeListener_Http(&HttpVirtualNodeListenerOptions{ OutlierDetection: &OutlierDetection{ BaseEjectionDuration: awscdk.Duration_Seconds(jsii.Number(10)), Interval: awscdk.Duration_*Seconds(jsii.Number(30)), MaxEjectionPercent: jsii.Number(50), MaxServerErrors: jsii.Number(5), }, }), }, })
type PublicDnsNamespace ¶
type PublicDnsNamespace interface { awscdk.Resource IPublicDnsNamespace // 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 // Namespace Arn for the namespace. NamespaceArn() *string // ID of hosted zone created by namespace. NamespaceHostedZoneId() *string // Namespace Id for the namespace. NamespaceId() *string // A name for the namespace. NamespaceName() *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 PublicDnsNamespaceArn() *string PublicDnsNamespaceId() *string PublicDnsNamespaceName() *string // The stack in which this resource is defined. Stack() awscdk.Stack // Type of the namespace. Type() NamespaceType // 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) // Creates a service within the namespace. CreateService(id *string, props *DnsServiceProps) Service 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 }
Define a Public DNS Namespace.
Example:
import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" app := cdk.NewApp() stack := cdk.NewStack(app, jsii.String("aws-servicediscovery-integ")) namespace := servicediscovery.NewPublicDnsNamespace(stack, jsii.String("Namespace"), &PublicDnsNamespaceProps{ Name: jsii.String("foobar.com"), }) service := namespace.CreateService(jsii.String("Service"), &DnsServiceProps{ Name: jsii.String("foo"), DnsRecordType: servicediscovery.DnsRecordType_A, DnsTtl: cdk.Duration_Seconds(jsii.Number(30)), HealthCheck: &HealthCheckConfig{ Type: servicediscovery.HealthCheckType_HTTPS, ResourcePath: jsii.String("/healthcheck"), FailureThreshold: jsii.Number(2), }, }) service.RegisterIpInstance(jsii.String("IpInstance"), &IpInstanceBaseProps{ Ipv4: jsii.String("54.239.25.192"), Port: jsii.Number(443), }) app.Synth()
func NewPublicDnsNamespace ¶
func NewPublicDnsNamespace(scope constructs.Construct, id *string, props *PublicDnsNamespaceProps) PublicDnsNamespace
type PublicDnsNamespaceAttributes ¶
type PublicDnsNamespaceAttributes struct { // Namespace ARN for the Namespace. NamespaceArn *string `field:"required" json:"namespaceArn" yaml:"namespaceArn"` // Namespace Id for the Namespace. NamespaceId *string `field:"required" json:"namespaceId" yaml:"namespaceId"` // A name for the Namespace. NamespaceName *string `field:"required" json:"namespaceName" yaml:"namespaceName"` }
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" publicDnsNamespaceAttributes := &PublicDnsNamespaceAttributes{ NamespaceArn: jsii.String("namespaceArn"), NamespaceId: jsii.String("namespaceId"), NamespaceName: jsii.String("namespaceName"), }
type PublicDnsNamespaceProps ¶
type PublicDnsNamespaceProps struct { // A name for the Namespace. Name *string `field:"required" json:"name" yaml:"name"` // A description of the Namespace. // Default: none. // Description *string `field:"optional" json:"description" yaml:"description"` }
Example:
import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" app := cdk.NewApp() stack := cdk.NewStack(app, jsii.String("aws-servicediscovery-integ")) namespace := servicediscovery.NewPublicDnsNamespace(stack, jsii.String("Namespace"), &PublicDnsNamespaceProps{ Name: jsii.String("foobar.com"), }) service := namespace.CreateService(jsii.String("Service"), &DnsServiceProps{ Name: jsii.String("foo"), DnsRecordType: servicediscovery.DnsRecordType_A, DnsTtl: cdk.Duration_Seconds(jsii.Number(30)), HealthCheck: &HealthCheckConfig{ Type: servicediscovery.HealthCheckType_HTTPS, ResourcePath: jsii.String("/healthcheck"), FailureThreshold: jsii.Number(2), }, }) service.RegisterIpInstance(jsii.String("IpInstance"), &IpInstanceBaseProps{ Ipv4: jsii.String("54.239.25.192"), Port: jsii.Number(443), }) app.Synth()
type RoutingPolicy ¶
type RoutingPolicy string
const ( // Route 53 returns the applicable value from one randomly selected instance from among the instances that you registered using the same service. RoutingPolicy_WEIGHTED RoutingPolicy = "WEIGHTED" // If you define a health check for the service and the health check is healthy, Route 53 returns the applicable value for up to eight instances. RoutingPolicy_MULTIVALUE RoutingPolicy = "MULTIVALUE" )
type Service ¶
type Service interface { awscdk.Resource IService // The discovery type used by this service. DiscoveryType() DiscoveryType // The DnsRecordType used by the service. DnsRecordType() DnsRecordType // 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 namespace for the Cloudmap Service. Namespace() INamespace // 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 Routing Policy used by the service. RoutingPolicy() RoutingPolicy // The Arn of the namespace that you want to use for DNS configuration. ServiceArn() *string // The ID of the namespace that you want to use for DNS configuration. ServiceId() *string // A name for the Cloudmap Service. ServiceName() *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 // Registers a resource that is accessible using a CNAME. RegisterCnameInstance(id *string, props *CnameInstanceBaseProps) IInstance // Registers a resource that is accessible using an IP address. RegisterIpInstance(id *string, props *IpInstanceBaseProps) IInstance // Registers an ELB as a new instance with unique name instanceId in this service. RegisterLoadBalancer(id *string, loadBalancer awselasticloadbalancingv2.ILoadBalancerV2, customAttributes *map[string]*string) IInstance // Registers a resource that is accessible using values other than an IP address or a domain name (CNAME). RegisterNonIpInstance(id *string, props *NonIpInstanceBaseProps) IInstance // Returns a string representation of this construct. ToString() *string }
Define a CloudMap Service.
Example:
import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" app := cdk.NewApp() stack := cdk.NewStack(app, jsii.String("aws-servicediscovery-integ")) namespace := servicediscovery.NewPublicDnsNamespace(stack, jsii.String("Namespace"), &PublicDnsNamespaceProps{ Name: jsii.String("foobar.com"), }) service := namespace.CreateService(jsii.String("Service"), &DnsServiceProps{ Name: jsii.String("foo"), DnsRecordType: servicediscovery.DnsRecordType_A, DnsTtl: cdk.Duration_Seconds(jsii.Number(30)), HealthCheck: &HealthCheckConfig{ Type: servicediscovery.HealthCheckType_HTTPS, ResourcePath: jsii.String("/healthcheck"), FailureThreshold: jsii.Number(2), }, }) service.RegisterIpInstance(jsii.String("IpInstance"), &IpInstanceBaseProps{ Ipv4: jsii.String("54.239.25.192"), Port: jsii.Number(443), }) app.Synth()
func NewService ¶
func NewService(scope constructs.Construct, id *string, props *ServiceProps) Service
type ServiceAttributes ¶
type ServiceAttributes struct { DnsRecordType DnsRecordType `field:"required" json:"dnsRecordType" yaml:"dnsRecordType"` Namespace INamespace `field:"required" json:"namespace" yaml:"namespace"` RoutingPolicy RoutingPolicy `field:"required" json:"routingPolicy" yaml:"routingPolicy"` ServiceArn *string `field:"required" json:"serviceArn" yaml:"serviceArn"` ServiceId *string `field:"required" json:"serviceId" yaml:"serviceId"` ServiceName *string `field:"required" json:"serviceName" yaml:"serviceName"` DiscoveryType DiscoveryType `field:"optional" json:"discoveryType" yaml:"discoveryType"` }
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" var namespace iNamespace serviceAttributes := &ServiceAttributes{ DnsRecordType: awscdk.Aws_servicediscovery.DnsRecordType_A, Namespace: namespace, RoutingPolicy: awscdk.*Aws_servicediscovery.RoutingPolicy_WEIGHTED, ServiceArn: jsii.String("serviceArn"), ServiceId: jsii.String("serviceId"), ServiceName: jsii.String("serviceName"), // the properties below are optional DiscoveryType: awscdk.*Aws_servicediscovery.DiscoveryType_API, }
type ServiceProps ¶
type ServiceProps struct { // Structure containing failure threshold for a custom health checker. // // Only one of healthCheckConfig or healthCheckCustomConfig can be specified. // See: https://docs.aws.amazon.com/cloud-map/latest/api/API_HealthCheckCustomConfig.html // Default: none. // CustomHealthCheck *HealthCheckCustomConfig `field:"optional" json:"customHealthCheck" yaml:"customHealthCheck"` // A description of the service. // Default: none. // Description *string `field:"optional" json:"description" yaml:"description"` // Settings for an optional health check. // // If you specify health check settings, AWS Cloud Map associates the health // check with the records that you specify in DnsConfig. Only one of healthCheckConfig or healthCheckCustomConfig can // be specified. Not valid for PrivateDnsNamespaces. If you use healthCheck, you can only register IP instances to // this service. // Default: none. // HealthCheck *HealthCheckConfig `field:"optional" json:"healthCheck" yaml:"healthCheck"` // A name for the Service. // Default: CloudFormation-generated name. // Name *string `field:"optional" json:"name" yaml:"name"` // Controls how instances within this service can be discovered. // Default: DNS_AND_API. // DiscoveryType DiscoveryType `field:"optional" json:"discoveryType" yaml:"discoveryType"` // The DNS type of the record that you want AWS Cloud Map to create. // // Supported record types // include A, AAAA, A and AAAA (A_AAAA), CNAME, and SRV. // Default: A. // DnsRecordType DnsRecordType `field:"optional" json:"dnsRecordType" yaml:"dnsRecordType"` // The amount of time, in seconds, that you want DNS resolvers to cache the settings for this record. // Default: Duration.minutes(1) // DnsTtl awscdk.Duration `field:"optional" json:"dnsTtl" yaml:"dnsTtl"` // Whether or not this service will have an Elastic LoadBalancer registered to it as an AliasTargetInstance. // // Setting this to `true` correctly configures the `routingPolicy` // and performs some additional validation. // Default: false. // LoadBalancer *bool `field:"optional" json:"loadBalancer" yaml:"loadBalancer"` // The routing policy that you want to apply to all DNS records that AWS Cloud Map creates when you register an instance and specify this service. // Default: WEIGHTED for CNAME records and when loadBalancer is true, MULTIVALUE otherwise. // RoutingPolicy RoutingPolicy `field:"optional" json:"routingPolicy" yaml:"routingPolicy"` // The namespace that you want to use for DNS configuration. Namespace INamespace `field:"required" json:"namespace" yaml:"namespace"` }
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import cdk "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var namespace iNamespace serviceProps := &ServiceProps{ Namespace: namespace, // the properties below are optional CustomHealthCheck: &HealthCheckCustomConfig{ FailureThreshold: jsii.Number(123), }, Description: jsii.String("description"), DiscoveryType: awscdk.Aws_servicediscovery.DiscoveryType_API, DnsRecordType: awscdk.*Aws_servicediscovery.DnsRecordType_A, DnsTtl: cdk.Duration_Minutes(jsii.Number(30)), HealthCheck: &HealthCheckConfig{ FailureThreshold: jsii.Number(123), ResourcePath: jsii.String("resourcePath"), Type: awscdk.*Aws_servicediscovery.HealthCheckType_HTTP, }, LoadBalancer: jsii.Boolean(false), Name: jsii.String("name"), RoutingPolicy: awscdk.*Aws_servicediscovery.RoutingPolicy_WEIGHTED, }
Source Files ¶
- AliasTargetInstance.go
- AliasTargetInstanceProps.go
- AliasTargetInstance__checks.go
- BaseInstanceProps.go
- BaseNamespaceProps.go
- BaseServiceProps.go
- CfnHttpNamespace.go
- CfnHttpNamespaceProps.go
- CfnHttpNamespace__checks.go
- CfnInstance.go
- CfnInstanceProps.go
- CfnInstance__checks.go
- CfnPrivateDnsNamespace.go
- CfnPrivateDnsNamespaceProps.go
- CfnPrivateDnsNamespace_PrivateDnsPropertiesMutableProperty.go
- CfnPrivateDnsNamespace_PropertiesProperty.go
- CfnPrivateDnsNamespace_SOAProperty.go
- CfnPrivateDnsNamespace__checks.go
- CfnPublicDnsNamespace.go
- CfnPublicDnsNamespaceProps.go
- CfnPublicDnsNamespace_PropertiesProperty.go
- CfnPublicDnsNamespace_PublicDnsPropertiesMutableProperty.go
- CfnPublicDnsNamespace_SOAProperty.go
- CfnPublicDnsNamespace__checks.go
- CfnService.go
- CfnServiceProps.go
- CfnService_DnsConfigProperty.go
- CfnService_DnsRecordProperty.go
- CfnService_HealthCheckConfigProperty.go
- CfnService_HealthCheckCustomConfigProperty.go
- CfnService__checks.go
- CnameInstance.go
- CnameInstanceBaseProps.go
- CnameInstanceProps.go
- CnameInstance__checks.go
- DiscoveryType.go
- DnsRecordType.go
- DnsServiceProps.go
- HealthCheckConfig.go
- HealthCheckCustomConfig.go
- HealthCheckType.go
- HttpNamespace.go
- HttpNamespaceAttributes.go
- HttpNamespaceProps.go
- HttpNamespace__checks.go
- IHttpNamespace.go
- IInstance.go
- INamespace.go
- IPrivateDnsNamespace.go
- IPublicDnsNamespace.go
- IService.go
- InstanceBase.go
- InstanceBase__checks.go
- IpInstance.go
- IpInstanceBaseProps.go
- IpInstanceProps.go
- IpInstance__checks.go
- NamespaceType.go
- NonIpInstance.go
- NonIpInstanceBaseProps.go
- NonIpInstanceProps.go
- NonIpInstance__checks.go
- PrivateDnsNamespace.go
- PrivateDnsNamespaceAttributes.go
- PrivateDnsNamespaceProps.go
- PrivateDnsNamespace__checks.go
- PublicDnsNamespace.go
- PublicDnsNamespaceAttributes.go
- PublicDnsNamespaceProps.go
- PublicDnsNamespace__checks.go
- RoutingPolicy.go
- Service.go
- ServiceAttributes.go
- ServiceProps.go
- Service__checks.go
- main.go