Documentation ¶
Index ¶
- func CfnDestination_CFN_RESOURCE_TYPE_NAME() *string
- func CfnDestination_IsCfnElement(x interface{}) *bool
- func CfnDestination_IsCfnResource(construct constructs.IConstruct) *bool
- func CfnDestination_IsConstruct(x interface{}) *bool
- func CfnLogGroup_CFN_RESOURCE_TYPE_NAME() *string
- func CfnLogGroup_IsCfnElement(x interface{}) *bool
- func CfnLogGroup_IsCfnResource(construct constructs.IConstruct) *bool
- func CfnLogGroup_IsConstruct(x interface{}) *bool
- func CfnLogStream_CFN_RESOURCE_TYPE_NAME() *string
- func CfnLogStream_IsCfnElement(x interface{}) *bool
- func CfnLogStream_IsCfnResource(construct constructs.IConstruct) *bool
- func CfnLogStream_IsConstruct(x interface{}) *bool
- func CfnMetricFilter_CFN_RESOURCE_TYPE_NAME() *string
- func CfnMetricFilter_IsCfnElement(x interface{}) *bool
- func CfnMetricFilter_IsCfnResource(construct constructs.IConstruct) *bool
- func CfnMetricFilter_IsConstruct(x interface{}) *bool
- func CfnQueryDefinition_CFN_RESOURCE_TYPE_NAME() *string
- func CfnQueryDefinition_IsCfnElement(x interface{}) *bool
- func CfnQueryDefinition_IsCfnResource(construct constructs.IConstruct) *bool
- func CfnQueryDefinition_IsConstruct(x interface{}) *bool
- func CfnResourcePolicy_CFN_RESOURCE_TYPE_NAME() *string
- func CfnResourcePolicy_IsCfnElement(x interface{}) *bool
- func CfnResourcePolicy_IsCfnResource(construct constructs.IConstruct) *bool
- func CfnResourcePolicy_IsConstruct(x interface{}) *bool
- func CfnSubscriptionFilter_CFN_RESOURCE_TYPE_NAME() *string
- func CfnSubscriptionFilter_IsCfnElement(x interface{}) *bool
- func CfnSubscriptionFilter_IsCfnResource(construct constructs.IConstruct) *bool
- func CfnSubscriptionFilter_IsConstruct(x interface{}) *bool
- func CrossAccountDestination_IsConstruct(x interface{}) *bool
- func CrossAccountDestination_IsResource(construct constructs.IConstruct) *bool
- func LogGroup_IsConstruct(x interface{}) *bool
- func LogGroup_IsResource(construct constructs.IConstruct) *bool
- func LogRetention_IsConstruct(x interface{}) *bool
- func LogStream_IsConstruct(x interface{}) *bool
- func LogStream_IsResource(construct constructs.IConstruct) *bool
- func MetricFilter_IsConstruct(x interface{}) *bool
- func MetricFilter_IsResource(construct constructs.IConstruct) *bool
- func NewCfnDestination_Override(c CfnDestination, scope constructs.Construct, id *string, ...)
- func NewCfnLogGroup_Override(c CfnLogGroup, scope constructs.Construct, id *string, props *CfnLogGroupProps)
- func NewCfnLogStream_Override(c CfnLogStream, scope constructs.Construct, id *string, ...)
- func NewCfnMetricFilter_Override(c CfnMetricFilter, scope constructs.Construct, id *string, ...)
- func NewCfnQueryDefinition_Override(c CfnQueryDefinition, scope constructs.Construct, id *string, ...)
- func NewCfnResourcePolicy_Override(c CfnResourcePolicy, scope constructs.Construct, id *string, ...)
- func NewCfnSubscriptionFilter_Override(c CfnSubscriptionFilter, scope constructs.Construct, id *string, ...)
- func NewCrossAccountDestination_Override(c CrossAccountDestination, scope constructs.Construct, id *string, ...)
- func NewFilterPattern_Override(f FilterPattern)
- func NewJsonPattern_Override(j JsonPattern, jsonPatternString *string)
- func NewLogGroup_Override(l LogGroup, scope constructs.Construct, id *string, props *LogGroupProps)
- func NewLogRetention_Override(l LogRetention, scope constructs.Construct, id *string, ...)
- func NewLogStream_Override(l LogStream, scope constructs.Construct, id *string, props *LogStreamProps)
- func NewMetricFilter_Override(m MetricFilter, scope constructs.Construct, id *string, ...)
- func NewQueryDefinition_Override(q QueryDefinition, scope constructs.Construct, id *string, ...)
- func NewQueryString_Override(q QueryString, props *QueryStringProps)
- func NewResourcePolicy_Override(r ResourcePolicy, scope constructs.Construct, id *string, ...)
- func NewSpaceDelimitedTextPattern_Override(s SpaceDelimitedTextPattern, columns *[]*string, ...)
- func NewSubscriptionFilter_Override(s SubscriptionFilter, scope constructs.Construct, id *string, ...)
- func QueryDefinition_IsConstruct(x interface{}) *bool
- func QueryDefinition_IsResource(construct constructs.IConstruct) *bool
- func ResourcePolicy_IsConstruct(x interface{}) *bool
- func ResourcePolicy_IsResource(construct constructs.IConstruct) *bool
- func SubscriptionFilter_IsConstruct(x interface{}) *bool
- func SubscriptionFilter_IsResource(construct constructs.IConstruct) *bool
- type CfnDestination
- type CfnDestinationProps
- type CfnLogGroup
- type CfnLogGroupProps
- type CfnLogStream
- type CfnLogStreamProps
- type CfnMetricFilter
- type CfnMetricFilterProps
- type CfnMetricFilter_MetricTransformationProperty
- type CfnQueryDefinition
- type CfnQueryDefinitionProps
- type CfnResourcePolicy
- type CfnResourcePolicyProps
- type CfnSubscriptionFilter
- type CfnSubscriptionFilterProps
- type ColumnRestriction
- type CrossAccountDestination
- type CrossAccountDestinationProps
- type FilterPattern
- type IFilterPattern
- func FilterPattern_AllEvents() IFilterPattern
- func FilterPattern_AllTerms(terms ...*string) IFilterPattern
- func FilterPattern_AnyTerm(terms ...*string) IFilterPattern
- func FilterPattern_AnyTermGroup(termGroups ...*[]*string) IFilterPattern
- func FilterPattern_Literal(logPatternString *string) IFilterPattern
- type ILogGroup
- type ILogStream
- type ILogSubscriptionDestination
- type JsonPattern
- func FilterPattern_All(patterns ...JsonPattern) JsonPattern
- func FilterPattern_Any(patterns ...JsonPattern) JsonPattern
- func FilterPattern_BooleanValue(jsonField *string, value *bool) JsonPattern
- func FilterPattern_Exists(jsonField *string) JsonPattern
- func FilterPattern_IsNull(jsonField *string) JsonPattern
- func FilterPattern_NotExists(jsonField *string) JsonPattern
- func FilterPattern_NumberValue(jsonField *string, comparison *string, value *float64) JsonPattern
- func FilterPattern_StringValue(jsonField *string, comparison *string, value *string) JsonPattern
- type LogGroup
- type LogGroupProps
- type LogRetention
- type LogRetentionProps
- type LogRetentionRetryOptions
- type LogStream
- type LogStreamProps
- type LogSubscriptionDestinationConfig
- type MetricFilter
- type MetricFilterOptions
- type MetricFilterProps
- type QueryDefinition
- type QueryDefinitionProps
- type QueryString
- type QueryStringProps
- type ResourcePolicy
- type ResourcePolicyProps
- type RetentionDays
- type SpaceDelimitedTextPattern
- type StreamOptions
- type SubscriptionFilter
- type SubscriptionFilterOptions
- type SubscriptionFilterProps
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CfnDestination_CFN_RESOURCE_TYPE_NAME ¶
func CfnDestination_CFN_RESOURCE_TYPE_NAME() *string
func CfnDestination_IsCfnElement ¶
func CfnDestination_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 CfnDestination_IsCfnResource ¶
func CfnDestination_IsCfnResource(construct constructs.IConstruct) *bool
Check whether the given construct is a CfnResource.
func CfnDestination_IsConstruct ¶
func CfnDestination_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 CfnLogGroup_CFN_RESOURCE_TYPE_NAME ¶
func CfnLogGroup_CFN_RESOURCE_TYPE_NAME() *string
func CfnLogGroup_IsCfnElement ¶
func CfnLogGroup_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 CfnLogGroup_IsCfnResource ¶
func CfnLogGroup_IsCfnResource(construct constructs.IConstruct) *bool
Check whether the given construct is a CfnResource.
func CfnLogGroup_IsConstruct ¶
func CfnLogGroup_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 CfnLogStream_CFN_RESOURCE_TYPE_NAME ¶
func CfnLogStream_CFN_RESOURCE_TYPE_NAME() *string
func CfnLogStream_IsCfnElement ¶
func CfnLogStream_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 CfnLogStream_IsCfnResource ¶
func CfnLogStream_IsCfnResource(construct constructs.IConstruct) *bool
Check whether the given construct is a CfnResource.
func CfnLogStream_IsConstruct ¶
func CfnLogStream_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 CfnMetricFilter_CFN_RESOURCE_TYPE_NAME ¶
func CfnMetricFilter_CFN_RESOURCE_TYPE_NAME() *string
func CfnMetricFilter_IsCfnElement ¶
func CfnMetricFilter_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 CfnMetricFilter_IsCfnResource ¶
func CfnMetricFilter_IsCfnResource(construct constructs.IConstruct) *bool
Check whether the given construct is a CfnResource.
func CfnMetricFilter_IsConstruct ¶
func CfnMetricFilter_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 CfnQueryDefinition_CFN_RESOURCE_TYPE_NAME ¶
func CfnQueryDefinition_CFN_RESOURCE_TYPE_NAME() *string
func CfnQueryDefinition_IsCfnElement ¶
func CfnQueryDefinition_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 CfnQueryDefinition_IsCfnResource ¶
func CfnQueryDefinition_IsCfnResource(construct constructs.IConstruct) *bool
Check whether the given construct is a CfnResource.
func CfnQueryDefinition_IsConstruct ¶
func CfnQueryDefinition_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 CfnResourcePolicy_CFN_RESOURCE_TYPE_NAME ¶
func CfnResourcePolicy_CFN_RESOURCE_TYPE_NAME() *string
func CfnResourcePolicy_IsCfnElement ¶
func CfnResourcePolicy_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 CfnResourcePolicy_IsCfnResource ¶
func CfnResourcePolicy_IsCfnResource(construct constructs.IConstruct) *bool
Check whether the given construct is a CfnResource.
func CfnResourcePolicy_IsConstruct ¶
func CfnResourcePolicy_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 CfnSubscriptionFilter_CFN_RESOURCE_TYPE_NAME ¶
func CfnSubscriptionFilter_CFN_RESOURCE_TYPE_NAME() *string
func CfnSubscriptionFilter_IsCfnElement ¶
func CfnSubscriptionFilter_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 CfnSubscriptionFilter_IsCfnResource ¶
func CfnSubscriptionFilter_IsCfnResource(construct constructs.IConstruct) *bool
Check whether the given construct is a CfnResource.
func CfnSubscriptionFilter_IsConstruct ¶
func CfnSubscriptionFilter_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 CrossAccountDestination_IsConstruct ¶
func CrossAccountDestination_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 CrossAccountDestination_IsResource ¶
func CrossAccountDestination_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource.
func LogGroup_IsConstruct ¶
func LogGroup_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 LogGroup_IsResource ¶
func LogGroup_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource.
func LogRetention_IsConstruct ¶
func LogRetention_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 LogStream_IsConstruct ¶
func LogStream_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 LogStream_IsResource ¶
func LogStream_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource.
func MetricFilter_IsConstruct ¶
func MetricFilter_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 MetricFilter_IsResource ¶
func MetricFilter_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource.
func NewCfnDestination_Override ¶
func NewCfnDestination_Override(c CfnDestination, scope constructs.Construct, id *string, props *CfnDestinationProps)
Create a new `AWS::Logs::Destination`.
func NewCfnLogGroup_Override ¶
func NewCfnLogGroup_Override(c CfnLogGroup, scope constructs.Construct, id *string, props *CfnLogGroupProps)
Create a new `AWS::Logs::LogGroup`.
func NewCfnLogStream_Override ¶
func NewCfnLogStream_Override(c CfnLogStream, scope constructs.Construct, id *string, props *CfnLogStreamProps)
Create a new `AWS::Logs::LogStream`.
func NewCfnMetricFilter_Override ¶
func NewCfnMetricFilter_Override(c CfnMetricFilter, scope constructs.Construct, id *string, props *CfnMetricFilterProps)
Create a new `AWS::Logs::MetricFilter`.
func NewCfnQueryDefinition_Override ¶
func NewCfnQueryDefinition_Override(c CfnQueryDefinition, scope constructs.Construct, id *string, props *CfnQueryDefinitionProps)
Create a new `AWS::Logs::QueryDefinition`.
func NewCfnResourcePolicy_Override ¶
func NewCfnResourcePolicy_Override(c CfnResourcePolicy, scope constructs.Construct, id *string, props *CfnResourcePolicyProps)
Create a new `AWS::Logs::ResourcePolicy`.
func NewCfnSubscriptionFilter_Override ¶
func NewCfnSubscriptionFilter_Override(c CfnSubscriptionFilter, scope constructs.Construct, id *string, props *CfnSubscriptionFilterProps)
Create a new `AWS::Logs::SubscriptionFilter`.
func NewCrossAccountDestination_Override ¶
func NewCrossAccountDestination_Override(c CrossAccountDestination, scope constructs.Construct, id *string, props *CrossAccountDestinationProps)
func NewFilterPattern_Override ¶
func NewFilterPattern_Override(f FilterPattern)
func NewJsonPattern_Override ¶
func NewJsonPattern_Override(j JsonPattern, jsonPatternString *string)
func NewLogGroup_Override ¶
func NewLogGroup_Override(l LogGroup, scope constructs.Construct, id *string, props *LogGroupProps)
func NewLogRetention_Override ¶
func NewLogRetention_Override(l LogRetention, scope constructs.Construct, id *string, props *LogRetentionProps)
func NewLogStream_Override ¶
func NewLogStream_Override(l LogStream, scope constructs.Construct, id *string, props *LogStreamProps)
func NewMetricFilter_Override ¶
func NewMetricFilter_Override(m MetricFilter, scope constructs.Construct, id *string, props *MetricFilterProps)
func NewQueryDefinition_Override ¶ added in v2.21.0
func NewQueryDefinition_Override(q QueryDefinition, scope constructs.Construct, id *string, props *QueryDefinitionProps)
func NewQueryString_Override ¶ added in v2.21.0
func NewQueryString_Override(q QueryString, props *QueryStringProps)
func NewResourcePolicy_Override ¶
func NewResourcePolicy_Override(r ResourcePolicy, scope constructs.Construct, id *string, props *ResourcePolicyProps)
func NewSpaceDelimitedTextPattern_Override ¶
func NewSpaceDelimitedTextPattern_Override(s SpaceDelimitedTextPattern, columns *[]*string, restrictions *map[string]*[]*ColumnRestriction)
func NewSubscriptionFilter_Override ¶
func NewSubscriptionFilter_Override(s SubscriptionFilter, scope constructs.Construct, id *string, props *SubscriptionFilterProps)
func QueryDefinition_IsConstruct ¶ added in v2.21.0
func QueryDefinition_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 QueryDefinition_IsResource ¶ added in v2.21.0
func QueryDefinition_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource.
func ResourcePolicy_IsConstruct ¶
func ResourcePolicy_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 ResourcePolicy_IsResource ¶
func ResourcePolicy_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource.
func SubscriptionFilter_IsConstruct ¶
func SubscriptionFilter_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 SubscriptionFilter_IsResource ¶
func SubscriptionFilter_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource.
Types ¶
type CfnDestination ¶
type CfnDestination interface { awscdk.CfnResource awscdk.IInspectable // The ARN of the CloudWatch Logs destination, such as `arn:aws:logs:us-west-1:123456789012:destination:MyDestination` . AttrArn() *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 name of the destination. DestinationName() *string SetDestinationName(val *string) // An IAM policy document that governs which AWS accounts can create subscription filters against this destination. DestinationPolicy() *string SetDestinationPolicy(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 ARN of an IAM role that permits CloudWatch Logs to send data to the specified AWS resource. RoleArn() *string SetRoleArn(val *string) // The stack in which this element is defined. // // CfnElements must be defined within a stack scope (directly or indirectly). Stack() awscdk.Stack // The Amazon Resource Name (ARN) of the physical target where the log events are delivered (for example, a Kinesis stream). TargetArn() *string SetTargetArn(val *string) // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperites() *map[string]interface{} // Syntactic sugar for `addOverride(path, undefined)`. AddDeletionOverride(path *string) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // // This can be used for resources across stacks (or nested stack) boundaries // and the dependency will automatically be transferred to the relevant scope. AddDependsOn(target awscdk.CfnResource) // Add a value to the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // AddMetadata(key *string, value interface{}) // Adds an override to the synthesized CloudFormation resource. // // To add a // property override, either use `addPropertyOverride` or prefix `path` with // "Properties." (i.e. `Properties.TopicName`). // // If the override is nested, separate each nested level using a dot (.) in the path parameter. // If there is an array as part of the nesting, specify the index in the path. // // To include a literal `.` in the property name, prefix with a `\`. In most // programming languages you will need to write this as `"\\."` because the // `\` itself will need to be escaped. // // For example, // “`typescript // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']); // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE'); // “` // would add the overrides // “`json // "Properties": { // "GlobalSecondaryIndexes": [ // { // "Projection": { // "NonKeyAttributes": [ "myattribute" ] // ... // } // ... // }, // { // "ProjectionType": "INCLUDE" // ... // }, // ] // ... // } // “` // // The `value` argument to `addOverride` will not be processed or translated // in any way. Pass raw JSON values in here with the correct capitalization // for CloudFormation. If you pass CDK classes or structs, they will be // rendered with lowercased key names, and CloudFormation will reject the // template. AddOverride(path *string, value interface{}) // Adds an override that deletes the value of a property from the resource definition. AddPropertyDeletionOverride(propertyPath *string) // Adds an override to a resource property. // // Syntactic sugar for `addOverride("Properties.<...>", value)`. AddPropertyOverride(propertyPath *string, value interface{}) // Sets the deletion policy of the resource based on the removal policy specified. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). 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) awscdk.Reference // Retrieve a value value from the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // GetMetadata(key *string) interface{} // Examines the CloudFormation resource and discloses attributes. Inspect(inspector awscdk.TreeInspector) // Overrides the auto-generated logical ID with a specific ID. OverrideLogicalId(newLogicalId *string) RenderProperties(props *map[string]interface{}) *map[string]interface{} // Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template. // // Returns: `true` if the resource should be included or `false` is the resource // should be omitted. ShouldSynthesize() *bool // Returns a string representation of this construct. // // Returns: a string representation of this resource. ToString() *string ValidateProperties(_properties interface{}) }
A CloudFormation `AWS::Logs::Destination`.
The AWS::Logs::Destination resource specifies a CloudWatch Logs destination. A destination encapsulates a physical resource (such as an Amazon Kinesis data stream) and enables you to subscribe that resource to a stream of log events.
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" cfnDestination := awscdk.Aws_logs.NewCfnDestination(this, jsii.String("MyCfnDestination"), &cfnDestinationProps{ destinationName: jsii.String("destinationName"), destinationPolicy: jsii.String("destinationPolicy"), roleArn: jsii.String("roleArn"), targetArn: jsii.String("targetArn"), })
func NewCfnDestination ¶
func NewCfnDestination(scope constructs.Construct, id *string, props *CfnDestinationProps) CfnDestination
Create a new `AWS::Logs::Destination`.
type CfnDestinationProps ¶
type CfnDestinationProps struct { // The name of the destination. DestinationName *string `field:"required" json:"destinationName" yaml:"destinationName"` // An IAM policy document that governs which AWS accounts can create subscription filters against this destination. DestinationPolicy *string `field:"required" json:"destinationPolicy" yaml:"destinationPolicy"` // The ARN of an IAM role that permits CloudWatch Logs to send data to the specified AWS resource. RoleArn *string `field:"required" json:"roleArn" yaml:"roleArn"` // The Amazon Resource Name (ARN) of the physical target where the log events are delivered (for example, a Kinesis stream). TargetArn *string `field:"required" json:"targetArn" yaml:"targetArn"` }
Properties for defining a `CfnDestination`.
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" cfnDestinationProps := &cfnDestinationProps{ destinationName: jsii.String("destinationName"), destinationPolicy: jsii.String("destinationPolicy"), roleArn: jsii.String("roleArn"), targetArn: jsii.String("targetArn"), }
type CfnLogGroup ¶
type CfnLogGroup interface { awscdk.CfnResource awscdk.IInspectable // The ARN of the log group, such as `arn:aws:logs:us-west-1:123456789012:log-group:/mystack-testgroup-12ABC1AB12A1:*`. AttrArn() *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 Amazon Resource Name (ARN) of the AWS KMS key to use when encrypting log data. // // To associate an AWS KMS key with the log group, specify the ARN of that KMS key here. If you do so, ingested data is encrypted using this key. This association is stored as long as the data encrypted with the KMS key is still within CloudWatch Logs . This enables CloudWatch Logs to decrypt this data whenever it is requested. // // If you attempt to associate a KMS key with the log group but the KMS key doesn't exist or is deactivated, you will receive an `InvalidParameterException` error. // // Log group data is always encrypted in CloudWatch Logs . If you omit this key, the encryption does not use AWS KMS . For more information, see [Encrypt log data in CloudWatch Logs using AWS Key Management Service](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/encrypt-log-data-kms.html) KmsKeyId() *string SetKmsKeyId(val *string) // The name of the log group. // // If you don't specify a name, AWS CloudFormation generates a unique ID for the log group. LogGroupName() *string SetLogGroupName(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 number of days to retain the log events in the specified log group. // // Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, 2192, 2557, 2922, 3288, and 3653. // // To set a log group to never have log events expire, use [DeleteRetentionPolicy](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DeleteRetentionPolicy.html) . RetentionInDays() *float64 SetRetentionInDays(val *float64) // The stack in which this element is defined. // // CfnElements must be defined within a stack scope (directly or indirectly). Stack() awscdk.Stack // An array of key-value pairs to apply to the log group. // // For more information, see [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html) . Tags() awscdk.TagManager // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperites() *map[string]interface{} // Syntactic sugar for `addOverride(path, undefined)`. AddDeletionOverride(path *string) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // // This can be used for resources across stacks (or nested stack) boundaries // and the dependency will automatically be transferred to the relevant scope. AddDependsOn(target awscdk.CfnResource) // Add a value to the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // AddMetadata(key *string, value interface{}) // Adds an override to the synthesized CloudFormation resource. // // To add a // property override, either use `addPropertyOverride` or prefix `path` with // "Properties." (i.e. `Properties.TopicName`). // // If the override is nested, separate each nested level using a dot (.) in the path parameter. // If there is an array as part of the nesting, specify the index in the path. // // To include a literal `.` in the property name, prefix with a `\`. In most // programming languages you will need to write this as `"\\."` because the // `\` itself will need to be escaped. // // For example, // “`typescript // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']); // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE'); // “` // would add the overrides // “`json // "Properties": { // "GlobalSecondaryIndexes": [ // { // "Projection": { // "NonKeyAttributes": [ "myattribute" ] // ... // } // ... // }, // { // "ProjectionType": "INCLUDE" // ... // }, // ] // ... // } // “` // // The `value` argument to `addOverride` will not be processed or translated // in any way. Pass raw JSON values in here with the correct capitalization // for CloudFormation. If you pass CDK classes or structs, they will be // rendered with lowercased key names, and CloudFormation will reject the // template. AddOverride(path *string, value interface{}) // Adds an override that deletes the value of a property from the resource definition. AddPropertyDeletionOverride(propertyPath *string) // Adds an override to a resource property. // // Syntactic sugar for `addOverride("Properties.<...>", value)`. AddPropertyOverride(propertyPath *string, value interface{}) // Sets the deletion policy of the resource based on the removal policy specified. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). 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) awscdk.Reference // Retrieve a value value from the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // GetMetadata(key *string) interface{} // Examines the CloudFormation resource and discloses attributes. Inspect(inspector awscdk.TreeInspector) // Overrides the auto-generated logical ID with a specific ID. OverrideLogicalId(newLogicalId *string) RenderProperties(props *map[string]interface{}) *map[string]interface{} // Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template. // // Returns: `true` if the resource should be included or `false` is the resource // should be omitted. ShouldSynthesize() *bool // Returns a string representation of this construct. // // Returns: a string representation of this resource. ToString() *string ValidateProperties(_properties interface{}) }
A CloudFormation `AWS::Logs::LogGroup`.
The `AWS::Logs::LogGroup` resource specifies a log group. A log group defines common properties for log streams, such as their retention and access control rules. Each log stream must belong to one log group.
You can create up to 1,000,000 log groups per Region per account. You must use the following guidelines when naming a log group:
- Log group names must be unique within a Region for an AWS account. - Log group names can be between 1 and 512 characters long. - Log group names consist of the following characters: a-z, A-Z, 0-9, '_' (underscore), '-' (hyphen), '/' (forward slash), and '.' (period).
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" cfnLogGroup := awscdk.Aws_logs.NewCfnLogGroup(this, jsii.String("MyCfnLogGroup"), &cfnLogGroupProps{ kmsKeyId: jsii.String("kmsKeyId"), logGroupName: jsii.String("logGroupName"), retentionInDays: jsii.Number(123), tags: []cfnTag{ &cfnTag{ key: jsii.String("key"), value: jsii.String("value"), }, }, })
func NewCfnLogGroup ¶
func NewCfnLogGroup(scope constructs.Construct, id *string, props *CfnLogGroupProps) CfnLogGroup
Create a new `AWS::Logs::LogGroup`.
type CfnLogGroupProps ¶
type CfnLogGroupProps struct { // The Amazon Resource Name (ARN) of the AWS KMS key to use when encrypting log data. // // To associate an AWS KMS key with the log group, specify the ARN of that KMS key here. If you do so, ingested data is encrypted using this key. This association is stored as long as the data encrypted with the KMS key is still within CloudWatch Logs . This enables CloudWatch Logs to decrypt this data whenever it is requested. // // If you attempt to associate a KMS key with the log group but the KMS key doesn't exist or is deactivated, you will receive an `InvalidParameterException` error. // // Log group data is always encrypted in CloudWatch Logs . If you omit this key, the encryption does not use AWS KMS . For more information, see [Encrypt log data in CloudWatch Logs using AWS Key Management Service](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/encrypt-log-data-kms.html) KmsKeyId *string `field:"optional" json:"kmsKeyId" yaml:"kmsKeyId"` // The name of the log group. // // If you don't specify a name, AWS CloudFormation generates a unique ID for the log group. LogGroupName *string `field:"optional" json:"logGroupName" yaml:"logGroupName"` // The number of days to retain the log events in the specified log group. // // Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, 2192, 2557, 2922, 3288, and 3653. // // To set a log group to never have log events expire, use [DeleteRetentionPolicy](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DeleteRetentionPolicy.html) . RetentionInDays *float64 `field:"optional" json:"retentionInDays" yaml:"retentionInDays"` // An array of key-value pairs to apply to the log group. // // For more information, see [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html) . Tags *[]*awscdk.CfnTag `field:"optional" json:"tags" yaml:"tags"` }
Properties for defining a `CfnLogGroup`.
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" cfnLogGroupProps := &cfnLogGroupProps{ kmsKeyId: jsii.String("kmsKeyId"), logGroupName: jsii.String("logGroupName"), retentionInDays: jsii.Number(123), tags: []cfnTag{ &cfnTag{ key: jsii.String("key"), value: jsii.String("value"), }, }, }
type CfnLogStream ¶
type CfnLogStream interface { awscdk.CfnResource awscdk.IInspectable // Options for this resource, such as condition, update policy etc. CfnOptions() awscdk.ICfnResourceOptions CfnProperties() *map[string]interface{} // AWS resource type. CfnResourceType() *string // Returns: the stack trace of the point where this Resource was created from, sourced // from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most // node +internal+ entries filtered. CreationStack() *[]*string // The name of the log group where the log stream is created. LogGroupName() *string SetLogGroupName(val *string) // The logical ID for this CloudFormation stack element. // // The logical ID of the element // is calculated from the path of the resource node in the construct tree. // // To override this value, use `overrideLogicalId(newLogicalId)`. // // Returns: the logical ID as a stringified token. This value will only get // resolved during synthesis. LogicalId() *string // The name of the log stream. // // The name must be unique within the log group. LogStreamName() *string SetLogStreamName(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 // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperites() *map[string]interface{} // Syntactic sugar for `addOverride(path, undefined)`. AddDeletionOverride(path *string) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // // This can be used for resources across stacks (or nested stack) boundaries // and the dependency will automatically be transferred to the relevant scope. AddDependsOn(target awscdk.CfnResource) // Add a value to the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // AddMetadata(key *string, value interface{}) // Adds an override to the synthesized CloudFormation resource. // // To add a // property override, either use `addPropertyOverride` or prefix `path` with // "Properties." (i.e. `Properties.TopicName`). // // If the override is nested, separate each nested level using a dot (.) in the path parameter. // If there is an array as part of the nesting, specify the index in the path. // // To include a literal `.` in the property name, prefix with a `\`. In most // programming languages you will need to write this as `"\\."` because the // `\` itself will need to be escaped. // // For example, // “`typescript // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']); // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE'); // “` // would add the overrides // “`json // "Properties": { // "GlobalSecondaryIndexes": [ // { // "Projection": { // "NonKeyAttributes": [ "myattribute" ] // ... // } // ... // }, // { // "ProjectionType": "INCLUDE" // ... // }, // ] // ... // } // “` // // The `value` argument to `addOverride` will not be processed or translated // in any way. Pass raw JSON values in here with the correct capitalization // for CloudFormation. If you pass CDK classes or structs, they will be // rendered with lowercased key names, and CloudFormation will reject the // template. AddOverride(path *string, value interface{}) // Adds an override that deletes the value of a property from the resource definition. AddPropertyDeletionOverride(propertyPath *string) // Adds an override to a resource property. // // Syntactic sugar for `addOverride("Properties.<...>", value)`. AddPropertyOverride(propertyPath *string, value interface{}) // Sets the deletion policy of the resource based on the removal policy specified. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). 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) awscdk.Reference // Retrieve a value value from the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // GetMetadata(key *string) interface{} // Examines the CloudFormation resource and discloses attributes. Inspect(inspector awscdk.TreeInspector) // Overrides the auto-generated logical ID with a specific ID. OverrideLogicalId(newLogicalId *string) RenderProperties(props *map[string]interface{}) *map[string]interface{} // Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template. // // Returns: `true` if the resource should be included or `false` is the resource // should be omitted. ShouldSynthesize() *bool // Returns a string representation of this construct. // // Returns: a string representation of this resource. ToString() *string ValidateProperties(_properties interface{}) }
A CloudFormation `AWS::Logs::LogStream`.
The `AWS::Logs::LogStream` resource specifies an Amazon CloudWatch Logs log stream in a specific log group. A log stream represents the sequence of events coming from an application instance or resource that you are monitoring.
There is no limit on the number of log streams that you can create for a log group.
You must use the following guidelines when naming a log stream:
- Log stream names must be unique within the log group. - Log stream names can be between 1 and 512 characters long. - The ':' (colon) and '*' (asterisk) characters are not allowed.
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" cfnLogStream := awscdk.Aws_logs.NewCfnLogStream(this, jsii.String("MyCfnLogStream"), &cfnLogStreamProps{ logGroupName: jsii.String("logGroupName"), // the properties below are optional logStreamName: jsii.String("logStreamName"), })
func NewCfnLogStream ¶
func NewCfnLogStream(scope constructs.Construct, id *string, props *CfnLogStreamProps) CfnLogStream
Create a new `AWS::Logs::LogStream`.
type CfnLogStreamProps ¶
type CfnLogStreamProps struct { // The name of the log group where the log stream is created. LogGroupName *string `field:"required" json:"logGroupName" yaml:"logGroupName"` // The name of the log stream. // // The name must be unique within the log group. LogStreamName *string `field:"optional" json:"logStreamName" yaml:"logStreamName"` }
Properties for defining a `CfnLogStream`.
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" cfnLogStreamProps := &cfnLogStreamProps{ logGroupName: jsii.String("logGroupName"), // the properties below are optional logStreamName: jsii.String("logStreamName"), }
type CfnMetricFilter ¶
type CfnMetricFilter 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 filter pattern for extracting metric data out of ingested log events. // // For more information, see [Filter and Pattern Syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html) . FilterPattern() *string SetFilterPattern(val *string) // The name of an existing log group that you want to associate with this metric filter. LogGroupName() *string SetLogGroupName(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 metric transformations. MetricTransformations() interface{} SetMetricTransformations(val interface{}) // 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 // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperites() *map[string]interface{} // Syntactic sugar for `addOverride(path, undefined)`. AddDeletionOverride(path *string) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // // This can be used for resources across stacks (or nested stack) boundaries // and the dependency will automatically be transferred to the relevant scope. AddDependsOn(target awscdk.CfnResource) // Add a value to the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // AddMetadata(key *string, value interface{}) // Adds an override to the synthesized CloudFormation resource. // // To add a // property override, either use `addPropertyOverride` or prefix `path` with // "Properties." (i.e. `Properties.TopicName`). // // If the override is nested, separate each nested level using a dot (.) in the path parameter. // If there is an array as part of the nesting, specify the index in the path. // // To include a literal `.` in the property name, prefix with a `\`. In most // programming languages you will need to write this as `"\\."` because the // `\` itself will need to be escaped. // // For example, // “`typescript // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']); // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE'); // “` // would add the overrides // “`json // "Properties": { // "GlobalSecondaryIndexes": [ // { // "Projection": { // "NonKeyAttributes": [ "myattribute" ] // ... // } // ... // }, // { // "ProjectionType": "INCLUDE" // ... // }, // ] // ... // } // “` // // The `value` argument to `addOverride` will not be processed or translated // in any way. Pass raw JSON values in here with the correct capitalization // for CloudFormation. If you pass CDK classes or structs, they will be // rendered with lowercased key names, and CloudFormation will reject the // template. AddOverride(path *string, value interface{}) // Adds an override that deletes the value of a property from the resource definition. AddPropertyDeletionOverride(propertyPath *string) // Adds an override to a resource property. // // Syntactic sugar for `addOverride("Properties.<...>", value)`. AddPropertyOverride(propertyPath *string, value interface{}) // Sets the deletion policy of the resource based on the removal policy specified. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). 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) awscdk.Reference // Retrieve a value value from the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // GetMetadata(key *string) interface{} // Examines the CloudFormation resource and discloses attributes. Inspect(inspector awscdk.TreeInspector) // Overrides the auto-generated logical ID with a specific ID. OverrideLogicalId(newLogicalId *string) RenderProperties(props *map[string]interface{}) *map[string]interface{} // Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template. // // Returns: `true` if the resource should be included or `false` is the resource // should be omitted. ShouldSynthesize() *bool // Returns a string representation of this construct. // // Returns: a string representation of this resource. ToString() *string ValidateProperties(_properties interface{}) }
A CloudFormation `AWS::Logs::MetricFilter`.
The `AWS::Logs::MetricFilter` resource specifies a metric filter that describes how CloudWatch Logs extracts information from logs and transforms it into Amazon CloudWatch metrics. If you have multiple metric filters that are associated with a log group, all the filters are applied to the log streams in that group.
The maximum number of metric filters that can be associated with a log group is 100.
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" cfnMetricFilter := awscdk.Aws_logs.NewCfnMetricFilter(this, jsii.String("MyCfnMetricFilter"), &cfnMetricFilterProps{ filterPattern: jsii.String("filterPattern"), logGroupName: jsii.String("logGroupName"), metricTransformations: []interface{}{ &metricTransformationProperty{ metricName: jsii.String("metricName"), metricNamespace: jsii.String("metricNamespace"), metricValue: jsii.String("metricValue"), // the properties below are optional defaultValue: jsii.Number(123), }, }, })
func NewCfnMetricFilter ¶
func NewCfnMetricFilter(scope constructs.Construct, id *string, props *CfnMetricFilterProps) CfnMetricFilter
Create a new `AWS::Logs::MetricFilter`.
type CfnMetricFilterProps ¶
type CfnMetricFilterProps struct { // A filter pattern for extracting metric data out of ingested log events. // // For more information, see [Filter and Pattern Syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html) . FilterPattern *string `field:"required" json:"filterPattern" yaml:"filterPattern"` // The name of an existing log group that you want to associate with this metric filter. LogGroupName *string `field:"required" json:"logGroupName" yaml:"logGroupName"` // The metric transformations. MetricTransformations interface{} `field:"required" json:"metricTransformations" yaml:"metricTransformations"` }
Properties for defining a `CfnMetricFilter`.
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" cfnMetricFilterProps := &cfnMetricFilterProps{ filterPattern: jsii.String("filterPattern"), logGroupName: jsii.String("logGroupName"), metricTransformations: []interface{}{ &metricTransformationProperty{ metricName: jsii.String("metricName"), metricNamespace: jsii.String("metricNamespace"), metricValue: jsii.String("metricValue"), // the properties below are optional defaultValue: jsii.Number(123), }, }, }
type CfnMetricFilter_MetricTransformationProperty ¶
type CfnMetricFilter_MetricTransformationProperty struct { // The name of the CloudWatch metric. MetricName *string `field:"required" json:"metricName" yaml:"metricName"` // A custom namespace to contain your metric in CloudWatch. // // Use namespaces to group together metrics that are similar. For more information, see [Namespaces](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Namespace) . MetricNamespace *string `field:"required" json:"metricNamespace" yaml:"metricNamespace"` // The value that is published to the CloudWatch metric. // // For example, if you're counting the occurrences of a particular term like `Error` , specify 1 for the metric value. If you're counting the number of bytes transferred, reference the value that is in the log event by using $ followed by the name of the field that you specified in the filter pattern, such as `$.size` . MetricValue *string `field:"required" json:"metricValue" yaml:"metricValue"` // (Optional) The value to emit when a filter pattern does not match a log event. // // This value can be null. DefaultValue *float64 `field:"optional" json:"defaultValue" yaml:"defaultValue"` }
`MetricTransformation` is a property of the `AWS::Logs::MetricFilter` resource that describes how to transform log streams into a CloudWatch metric.
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" metricTransformationProperty := &metricTransformationProperty{ metricName: jsii.String("metricName"), metricNamespace: jsii.String("metricNamespace"), metricValue: jsii.String("metricValue"), // the properties below are optional defaultValue: jsii.Number(123), }
type CfnQueryDefinition ¶
type CfnQueryDefinition interface { awscdk.CfnResource awscdk.IInspectable // The ID of the query definition. AttrQueryDefinitionId() *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 // Use this parameter if you want the query to query only certain log groups. LogGroupNames() *[]*string SetLogGroupNames(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 // A name for the query definition. Name() *string SetName(val *string) // The tree node. Node() constructs.Node // The query string to use for this query definition. // // For more information, see [CloudWatch Logs Insights Query Syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html) . QueryString() *string SetQueryString(val *string) // Return a string that will be resolved to a CloudFormation `{ Ref }` for this element. // // If, by any chance, the intrinsic reference of a resource is not a string, you could // coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`. Ref() *string // The stack in which this element is defined. // // CfnElements must be defined within a stack scope (directly or indirectly). Stack() awscdk.Stack // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperites() *map[string]interface{} // Syntactic sugar for `addOverride(path, undefined)`. AddDeletionOverride(path *string) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // // This can be used for resources across stacks (or nested stack) boundaries // and the dependency will automatically be transferred to the relevant scope. AddDependsOn(target awscdk.CfnResource) // Add a value to the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // AddMetadata(key *string, value interface{}) // Adds an override to the synthesized CloudFormation resource. // // To add a // property override, either use `addPropertyOverride` or prefix `path` with // "Properties." (i.e. `Properties.TopicName`). // // If the override is nested, separate each nested level using a dot (.) in the path parameter. // If there is an array as part of the nesting, specify the index in the path. // // To include a literal `.` in the property name, prefix with a `\`. In most // programming languages you will need to write this as `"\\."` because the // `\` itself will need to be escaped. // // For example, // “`typescript // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']); // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE'); // “` // would add the overrides // “`json // "Properties": { // "GlobalSecondaryIndexes": [ // { // "Projection": { // "NonKeyAttributes": [ "myattribute" ] // ... // } // ... // }, // { // "ProjectionType": "INCLUDE" // ... // }, // ] // ... // } // “` // // The `value` argument to `addOverride` will not be processed or translated // in any way. Pass raw JSON values in here with the correct capitalization // for CloudFormation. If you pass CDK classes or structs, they will be // rendered with lowercased key names, and CloudFormation will reject the // template. AddOverride(path *string, value interface{}) // Adds an override that deletes the value of a property from the resource definition. AddPropertyDeletionOverride(propertyPath *string) // Adds an override to a resource property. // // Syntactic sugar for `addOverride("Properties.<...>", value)`. AddPropertyOverride(propertyPath *string, value interface{}) // Sets the deletion policy of the resource based on the removal policy specified. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). 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) awscdk.Reference // Retrieve a value value from the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // GetMetadata(key *string) interface{} // Examines the CloudFormation resource and discloses attributes. Inspect(inspector awscdk.TreeInspector) // Overrides the auto-generated logical ID with a specific ID. OverrideLogicalId(newLogicalId *string) RenderProperties(props *map[string]interface{}) *map[string]interface{} // Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template. // // Returns: `true` if the resource should be included or `false` is the resource // should be omitted. ShouldSynthesize() *bool // Returns a string representation of this construct. // // Returns: a string representation of this resource. ToString() *string ValidateProperties(_properties interface{}) }
A CloudFormation `AWS::Logs::QueryDefinition`.
Creates a query definition for CloudWatch Logs Insights. For more information, see [Analyzing Log Data with CloudWatch Logs Insights](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AnalyzingLogData.html) .
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" cfnQueryDefinition := awscdk.Aws_logs.NewCfnQueryDefinition(this, jsii.String("MyCfnQueryDefinition"), &cfnQueryDefinitionProps{ name: jsii.String("name"), queryString: jsii.String("queryString"), // the properties below are optional logGroupNames: []*string{ jsii.String("logGroupNames"), }, })
func NewCfnQueryDefinition ¶
func NewCfnQueryDefinition(scope constructs.Construct, id *string, props *CfnQueryDefinitionProps) CfnQueryDefinition
Create a new `AWS::Logs::QueryDefinition`.
type CfnQueryDefinitionProps ¶
type CfnQueryDefinitionProps struct { // A name for the query definition. Name *string `field:"required" json:"name" yaml:"name"` // The query string to use for this query definition. // // For more information, see [CloudWatch Logs Insights Query Syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html) . QueryString *string `field:"required" json:"queryString" yaml:"queryString"` // Use this parameter if you want the query to query only certain log groups. LogGroupNames *[]*string `field:"optional" json:"logGroupNames" yaml:"logGroupNames"` }
Properties for defining a `CfnQueryDefinition`.
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" cfnQueryDefinitionProps := &cfnQueryDefinitionProps{ name: jsii.String("name"), queryString: jsii.String("queryString"), // the properties below are optional logGroupNames: []*string{ jsii.String("logGroupNames"), }, }
type CfnResourcePolicy ¶
type CfnResourcePolicy interface { awscdk.CfnResource awscdk.IInspectable // Options for this resource, such as condition, update policy etc. CfnOptions() awscdk.ICfnResourceOptions CfnProperties() *map[string]interface{} // AWS resource type. CfnResourceType() *string // Returns: the stack trace of the point where this Resource was created from, sourced // from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most // node +internal+ entries filtered. CreationStack() *[]*string // The logical ID for this CloudFormation stack element. // // The logical ID of the element // is calculated from the path of the resource node in the construct tree. // // To override this value, use `overrideLogicalId(newLogicalId)`. // // Returns: the logical ID as a stringified token. This value will only get // resolved during synthesis. LogicalId() *string // The tree node. Node() constructs.Node // The details of the policy. // // It must be formatted in JSON, and you must use backslashes to escape characters that need to be escaped in JSON strings, such as double quote marks. PolicyDocument() *string SetPolicyDocument(val *string) // The name of the resource policy. PolicyName() *string SetPolicyName(val *string) // Return a string that will be resolved to a CloudFormation `{ Ref }` for this element. // // If, by any chance, the intrinsic reference of a resource is not a string, you could // coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`. Ref() *string // The stack in which this element is defined. // // CfnElements must be defined within a stack scope (directly or indirectly). Stack() awscdk.Stack // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperites() *map[string]interface{} // Syntactic sugar for `addOverride(path, undefined)`. AddDeletionOverride(path *string) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // // This can be used for resources across stacks (or nested stack) boundaries // and the dependency will automatically be transferred to the relevant scope. AddDependsOn(target awscdk.CfnResource) // Add a value to the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // AddMetadata(key *string, value interface{}) // Adds an override to the synthesized CloudFormation resource. // // To add a // property override, either use `addPropertyOverride` or prefix `path` with // "Properties." (i.e. `Properties.TopicName`). // // If the override is nested, separate each nested level using a dot (.) in the path parameter. // If there is an array as part of the nesting, specify the index in the path. // // To include a literal `.` in the property name, prefix with a `\`. In most // programming languages you will need to write this as `"\\."` because the // `\` itself will need to be escaped. // // For example, // “`typescript // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']); // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE'); // “` // would add the overrides // “`json // "Properties": { // "GlobalSecondaryIndexes": [ // { // "Projection": { // "NonKeyAttributes": [ "myattribute" ] // ... // } // ... // }, // { // "ProjectionType": "INCLUDE" // ... // }, // ] // ... // } // “` // // The `value` argument to `addOverride` will not be processed or translated // in any way. Pass raw JSON values in here with the correct capitalization // for CloudFormation. If you pass CDK classes or structs, they will be // rendered with lowercased key names, and CloudFormation will reject the // template. AddOverride(path *string, value interface{}) // Adds an override that deletes the value of a property from the resource definition. AddPropertyDeletionOverride(propertyPath *string) // Adds an override to a resource property. // // Syntactic sugar for `addOverride("Properties.<...>", value)`. AddPropertyOverride(propertyPath *string, value interface{}) // Sets the deletion policy of the resource based on the removal policy specified. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). 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) awscdk.Reference // Retrieve a value value from the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // GetMetadata(key *string) interface{} // Examines the CloudFormation resource and discloses attributes. Inspect(inspector awscdk.TreeInspector) // Overrides the auto-generated logical ID with a specific ID. OverrideLogicalId(newLogicalId *string) RenderProperties(props *map[string]interface{}) *map[string]interface{} // Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template. // // Returns: `true` if the resource should be included or `false` is the resource // should be omitted. ShouldSynthesize() *bool // Returns a string representation of this construct. // // Returns: a string representation of this resource. ToString() *string ValidateProperties(_properties interface{}) }
A CloudFormation `AWS::Logs::ResourcePolicy`.
Creates or updates a resource policy that allows other AWS services to put log events to this account. An account can have up to 10 resource policies per AWS Region.
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" cfnResourcePolicy := awscdk.Aws_logs.NewCfnResourcePolicy(this, jsii.String("MyCfnResourcePolicy"), &cfnResourcePolicyProps{ policyDocument: jsii.String("policyDocument"), policyName: jsii.String("policyName"), })
func NewCfnResourcePolicy ¶
func NewCfnResourcePolicy(scope constructs.Construct, id *string, props *CfnResourcePolicyProps) CfnResourcePolicy
Create a new `AWS::Logs::ResourcePolicy`.
type CfnResourcePolicyProps ¶
type CfnResourcePolicyProps struct { // The details of the policy. // // It must be formatted in JSON, and you must use backslashes to escape characters that need to be escaped in JSON strings, such as double quote marks. PolicyDocument *string `field:"required" json:"policyDocument" yaml:"policyDocument"` // The name of the resource policy. PolicyName *string `field:"required" json:"policyName" yaml:"policyName"` }
Properties for defining a `CfnResourcePolicy`.
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" cfnResourcePolicyProps := &cfnResourcePolicyProps{ policyDocument: jsii.String("policyDocument"), policyName: jsii.String("policyName"), }
type CfnSubscriptionFilter ¶
type CfnSubscriptionFilter interface { awscdk.CfnResource awscdk.IInspectable // Options for this resource, such as condition, update policy etc. CfnOptions() awscdk.ICfnResourceOptions CfnProperties() *map[string]interface{} // AWS resource type. CfnResourceType() *string // Returns: the stack trace of the point where this Resource was created from, sourced // from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most // node +internal+ entries filtered. CreationStack() *[]*string // The Amazon Resource Name (ARN) of the destination. DestinationArn() *string SetDestinationArn(val *string) // The filtering expressions that restrict what gets delivered to the destination AWS resource. // // For more information about the filter pattern syntax, see [Filter and Pattern Syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html) . FilterPattern() *string SetFilterPattern(val *string) // The log group to associate with the subscription filter. // // All log events that are uploaded to this log group are filtered and delivered to the specified AWS resource if the filter pattern matches the log events. LogGroupName() *string SetLogGroupName(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 ARN of an IAM role that grants CloudWatch Logs permissions to deliver ingested log events to the destination stream. // // You don't need to provide the ARN when you are working with a logical destination for cross-account delivery. RoleArn() *string SetRoleArn(val *string) // The stack in which this element is defined. // // CfnElements must be defined within a stack scope (directly or indirectly). Stack() awscdk.Stack // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperites() *map[string]interface{} // Syntactic sugar for `addOverride(path, undefined)`. AddDeletionOverride(path *string) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // // This can be used for resources across stacks (or nested stack) boundaries // and the dependency will automatically be transferred to the relevant scope. AddDependsOn(target awscdk.CfnResource) // Add a value to the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // AddMetadata(key *string, value interface{}) // Adds an override to the synthesized CloudFormation resource. // // To add a // property override, either use `addPropertyOverride` or prefix `path` with // "Properties." (i.e. `Properties.TopicName`). // // If the override is nested, separate each nested level using a dot (.) in the path parameter. // If there is an array as part of the nesting, specify the index in the path. // // To include a literal `.` in the property name, prefix with a `\`. In most // programming languages you will need to write this as `"\\."` because the // `\` itself will need to be escaped. // // For example, // “`typescript // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']); // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE'); // “` // would add the overrides // “`json // "Properties": { // "GlobalSecondaryIndexes": [ // { // "Projection": { // "NonKeyAttributes": [ "myattribute" ] // ... // } // ... // }, // { // "ProjectionType": "INCLUDE" // ... // }, // ] // ... // } // “` // // The `value` argument to `addOverride` will not be processed or translated // in any way. Pass raw JSON values in here with the correct capitalization // for CloudFormation. If you pass CDK classes or structs, they will be // rendered with lowercased key names, and CloudFormation will reject the // template. AddOverride(path *string, value interface{}) // Adds an override that deletes the value of a property from the resource definition. AddPropertyDeletionOverride(propertyPath *string) // Adds an override to a resource property. // // Syntactic sugar for `addOverride("Properties.<...>", value)`. AddPropertyOverride(propertyPath *string, value interface{}) // Sets the deletion policy of the resource based on the removal policy specified. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). 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) awscdk.Reference // Retrieve a value value from the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // GetMetadata(key *string) interface{} // Examines the CloudFormation resource and discloses attributes. Inspect(inspector awscdk.TreeInspector) // Overrides the auto-generated logical ID with a specific ID. OverrideLogicalId(newLogicalId *string) RenderProperties(props *map[string]interface{}) *map[string]interface{} // Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template. // // Returns: `true` if the resource should be included or `false` is the resource // should be omitted. ShouldSynthesize() *bool // Returns a string representation of this construct. // // Returns: a string representation of this resource. ToString() *string ValidateProperties(_properties interface{}) }
A CloudFormation `AWS::Logs::SubscriptionFilter`.
The `AWS::Logs::SubscriptionFilter` resource specifies a subscription filter and associates it with the specified log group. Subscription filters allow you to subscribe to a real-time stream of log events and have them delivered to a specific destination. Currently, the supported destinations are:
- An Amazon Kinesis data stream belonging to the same account as the subscription filter, for same-account delivery. - A logical destination that belongs to a different account, for cross-account delivery. - An Amazon Kinesis Firehose delivery stream that belongs to the same account as the subscription filter, for same-account delivery. - An AWS Lambda function that belongs to the same account as the subscription filter, for same-account delivery.
There can as many as two subscription filters associated with a log group.
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" cfnSubscriptionFilter := awscdk.Aws_logs.NewCfnSubscriptionFilter(this, jsii.String("MyCfnSubscriptionFilter"), &cfnSubscriptionFilterProps{ destinationArn: jsii.String("destinationArn"), filterPattern: jsii.String("filterPattern"), logGroupName: jsii.String("logGroupName"), // the properties below are optional roleArn: jsii.String("roleArn"), })
func NewCfnSubscriptionFilter ¶
func NewCfnSubscriptionFilter(scope constructs.Construct, id *string, props *CfnSubscriptionFilterProps) CfnSubscriptionFilter
Create a new `AWS::Logs::SubscriptionFilter`.
type CfnSubscriptionFilterProps ¶
type CfnSubscriptionFilterProps struct { // The Amazon Resource Name (ARN) of the destination. DestinationArn *string `field:"required" json:"destinationArn" yaml:"destinationArn"` // The filtering expressions that restrict what gets delivered to the destination AWS resource. // // For more information about the filter pattern syntax, see [Filter and Pattern Syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html) . FilterPattern *string `field:"required" json:"filterPattern" yaml:"filterPattern"` // The log group to associate with the subscription filter. // // All log events that are uploaded to this log group are filtered and delivered to the specified AWS resource if the filter pattern matches the log events. LogGroupName *string `field:"required" json:"logGroupName" yaml:"logGroupName"` // The ARN of an IAM role that grants CloudWatch Logs permissions to deliver ingested log events to the destination stream. // // You don't need to provide the ARN when you are working with a logical destination for cross-account delivery. RoleArn *string `field:"optional" json:"roleArn" yaml:"roleArn"` }
Properties for defining a `CfnSubscriptionFilter`.
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" cfnSubscriptionFilterProps := &cfnSubscriptionFilterProps{ destinationArn: jsii.String("destinationArn"), filterPattern: jsii.String("filterPattern"), logGroupName: jsii.String("logGroupName"), // the properties below are optional roleArn: jsii.String("roleArn"), }
type ColumnRestriction ¶
type ColumnRestriction struct { // Comparison operator to use. Comparison *string `field:"required" json:"comparison" yaml:"comparison"` // Number value to compare to. // // Exactly one of 'stringValue' and 'numberValue' must be set. NumberValue *float64 `field:"optional" json:"numberValue" yaml:"numberValue"` // String value to compare to. // // Exactly one of 'stringValue' and 'numberValue' must be set. StringValue *string `field:"optional" json:"stringValue" yaml:"stringValue"` }
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" columnRestriction := &columnRestriction{ comparison: jsii.String("comparison"), // the properties below are optional numberValue: jsii.Number(123), stringValue: jsii.String("stringValue"), }
type CrossAccountDestination ¶
type CrossAccountDestination interface { awscdk.Resource ILogSubscriptionDestination // The ARN of this CrossAccountDestination object. DestinationArn() *string // The name of this CrossAccountDestination object. DestinationName() *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 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 // Policy object of this CrossAccountDestination object. PolicyDocument() awsiam.PolicyDocument // The stack in which this resource is defined. Stack() awscdk.Stack AddToPolicy(statement awsiam.PolicyStatement) // 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) // Return the properties required to send subscription events to this destination. // // If necessary, the destination can use the properties of the SubscriptionFilter // object itself to configure its permissions to allow the subscription to write // to it. // // The destination may reconfigure its own permissions in response to this // function call. Bind(_scope constructs.Construct, _sourceLogGroup ILogGroup) *LogSubscriptionDestinationConfig GeneratePhysicalName() *string // Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`). // // Normally, this token will resolve to `arnAttr`, but if the resource is // referenced across environments, `arnComponents` will be used to synthesize // a concrete ARN with the resource's physical name. Make sure to reference // `this.physicalName` in `arnComponents`. GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string // Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`). // // Normally, this token will resolve to `nameAttr`, but if the resource is // referenced across environments, it will be resolved to `this.physicalName`, // which will be a concrete name. GetResourceNameAttribute(nameAttr *string) *string // Returns a string representation of this construct. ToString() *string }
A new CloudWatch Logs Destination for use in cross-account scenarios.
CrossAccountDestinations are used to subscribe a Kinesis stream in a different account to a CloudWatch Subscription.
Consumers will hardly ever need to use this class. Instead, directly subscribe a Kinesis stream using the integration class in the `@aws-cdk/aws-logs-destinations` package; if necessary, a `CrossAccountDestination` will be created automatically.
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" import "github.com/aws/aws-cdk-go/awscdk" var role role crossAccountDestination := awscdk.Aws_logs.NewCrossAccountDestination(this, jsii.String("MyCrossAccountDestination"), &crossAccountDestinationProps{ role: role, targetArn: jsii.String("targetArn"), // the properties below are optional destinationName: jsii.String("destinationName"), })
func NewCrossAccountDestination ¶
func NewCrossAccountDestination(scope constructs.Construct, id *string, props *CrossAccountDestinationProps) CrossAccountDestination
type CrossAccountDestinationProps ¶
type CrossAccountDestinationProps struct { // The role to assume that grants permissions to write to 'target'. // // The role must be assumable by 'logs.{REGION}.amazonaws.com'. Role awsiam.IRole `field:"required" json:"role" yaml:"role"` // The log destination target's ARN. TargetArn *string `field:"required" json:"targetArn" yaml:"targetArn"` // The name of the log destination. DestinationName *string `field:"optional" json:"destinationName" yaml:"destinationName"` }
Properties for a CrossAccountDestination.
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" import "github.com/aws/aws-cdk-go/awscdk" var role role crossAccountDestinationProps := &crossAccountDestinationProps{ role: role, targetArn: jsii.String("targetArn"), // the properties below are optional destinationName: jsii.String("destinationName"), }
type FilterPattern ¶
type FilterPattern interface { }
A collection of static methods to generate appropriate ILogPatterns.
Example:
// Search for lines that contain both "ERROR" and "MainThread" pattern1 := logs.filterPattern.allTerms(jsii.String("ERROR"), jsii.String("MainThread")) // Search for lines that either contain both "ERROR" and "MainThread", or // both "WARN" and "Deadlock". pattern2 := logs.filterPattern.anyTermGroup([]*string{ jsii.String("ERROR"), jsii.String("MainThread"), }, []*string{ jsii.String("WARN"), jsii.String("Deadlock"), })
func NewFilterPattern ¶
func NewFilterPattern() FilterPattern
type IFilterPattern ¶
type IFilterPattern interface {
LogPatternString() *string
}
Interface for objects that can render themselves to log patterns.
func FilterPattern_AllEvents ¶
func FilterPattern_AllEvents() IFilterPattern
A log pattern that matches all events.
func FilterPattern_AllTerms ¶
func FilterPattern_AllTerms(terms ...*string) IFilterPattern
A log pattern that matches if all the strings given appear in the event.
func FilterPattern_AnyTerm ¶
func FilterPattern_AnyTerm(terms ...*string) IFilterPattern
A log pattern that matches if any of the strings given appear in the event.
func FilterPattern_AnyTermGroup ¶
func FilterPattern_AnyTermGroup(termGroups ...*[]*string) IFilterPattern
A log pattern that matches if any of the given term groups matches the event.
A term group matches an event if all the terms in it appear in the event string.
func FilterPattern_Literal ¶
func FilterPattern_Literal(logPatternString *string) IFilterPattern
Use the given string as log pattern.
See https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html for information on writing log patterns.
type ILogGroup ¶
type ILogGroup interface { awsiam.IResourceWithPolicy // Create a new Metric Filter on this Log Group. AddMetricFilter(id *string, props *MetricFilterOptions) MetricFilter // Create a new Log Stream for this Log Group. AddStream(id *string, props *StreamOptions) LogStream // Create a new Subscription Filter on this Log Group. AddSubscriptionFilter(id *string, props *SubscriptionFilterOptions) SubscriptionFilter // Extract a metric from structured log events in the LogGroup. // // Creates a MetricFilter on this LogGroup that will extract the value // of the indicated JSON field in all records where it occurs. // // The metric will be available in CloudWatch Metrics under the // indicated namespace and name. // // Returns: A Metric object representing the extracted metric. ExtractMetric(jsonField *string, metricNamespace *string, metricName *string) awscloudwatch.Metric // Give the indicated permissions on this log group and all streams. Grant(grantee awsiam.IGrantable, actions ...*string) awsiam.Grant // Give permissions to write to create and write to streams in this log group. GrantWrite(grantee awsiam.IGrantable) awsiam.Grant // Public method to get the physical name of this log group. LogGroupPhysicalName() *string // The ARN of this log group, with ':*' appended. LogGroupArn() *string // The name of this log group. LogGroupName() *string }
func LogGroup_FromLogGroupArn ¶
func LogGroup_FromLogGroupArn(scope constructs.Construct, id *string, logGroupArn *string) ILogGroup
Import an existing LogGroup given its ARN.
func LogGroup_FromLogGroupName ¶
func LogGroup_FromLogGroupName(scope constructs.Construct, id *string, logGroupName *string) ILogGroup
Import an existing LogGroup given its name.
type ILogStream ¶
type ILogStream interface { awscdk.IResource // The name of this log stream. LogStreamName() *string }
func LogStream_FromLogStreamName ¶
func LogStream_FromLogStreamName(scope constructs.Construct, id *string, logStreamName *string) ILogStream
Import an existing LogGroup.
type ILogSubscriptionDestination ¶
type ILogSubscriptionDestination interface { // Return the properties required to send subscription events to this destination. // // If necessary, the destination can use the properties of the SubscriptionFilter // object itself to configure its permissions to allow the subscription to write // to it. // // The destination may reconfigure its own permissions in response to this // function call. Bind(scope constructs.Construct, sourceLogGroup ILogGroup) *LogSubscriptionDestinationConfig }
Interface for classes that can be the destination of a log Subscription.
type JsonPattern ¶
type JsonPattern interface { IFilterPattern JsonPatternString() *string LogPatternString() *string }
Base class for patterns that only match JSON log events.
Example:
// Search for all events where the component field is equal to // "HttpServer" and either error is true or the latency is higher // than 1000. pattern := logs.filterPattern.all(logs.filterPattern.stringValue(jsii.String("$.component"), jsii.String("="), jsii.String("HttpServer")), logs.filterPattern.any(logs.filterPattern.booleanValue(jsii.String("$.error"), jsii.Boolean(true)), logs.filterPattern.numberValue(jsii.String("$.latency"), jsii.String(">"), jsii.Number(1000))))
func FilterPattern_All ¶
func FilterPattern_All(patterns ...JsonPattern) JsonPattern
A JSON log pattern that matches if all given JSON log patterns match.
func FilterPattern_Any ¶
func FilterPattern_Any(patterns ...JsonPattern) JsonPattern
A JSON log pattern that matches if any of the given JSON log patterns match.
func FilterPattern_BooleanValue ¶
func FilterPattern_BooleanValue(jsonField *string, value *bool) JsonPattern
A JSON log pattern that matches if the field exists and equals the boolean value.
func FilterPattern_Exists ¶
func FilterPattern_Exists(jsonField *string) JsonPattern
A JSON log patter that matches if the field exists.
This is a readable convenience wrapper over 'field = *'.
func FilterPattern_IsNull ¶
func FilterPattern_IsNull(jsonField *string) JsonPattern
A JSON log pattern that matches if the field exists and has the special value 'null'.
func FilterPattern_NotExists ¶
func FilterPattern_NotExists(jsonField *string) JsonPattern
A JSON log pattern that matches if the field does not exist.
func FilterPattern_NumberValue ¶
func FilterPattern_NumberValue(jsonField *string, comparison *string, value *float64) JsonPattern
A JSON log pattern that compares numerical values.
This pattern only matches if the event is a JSON event, and the indicated field inside compares with the value in the indicated way.
Use '$' to indicate the root of the JSON structure. The comparison operator can only compare equality or inequality. The '*' wildcard may appear in the value may at the start or at the end.
For more information, see:
https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html
func FilterPattern_StringValue ¶
func FilterPattern_StringValue(jsonField *string, comparison *string, value *string) JsonPattern
A JSON log pattern that compares string values.
This pattern only matches if the event is a JSON event, and the indicated field inside compares with the string value.
Use '$' to indicate the root of the JSON structure. The comparison operator can only compare equality or inequality. The '*' wildcard may appear in the value may at the start or at the end.
For more information, see:
https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html
type LogGroup ¶
type LogGroup interface { awscdk.Resource ILogGroup // 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 ARN of this log group. LogGroupArn() *string // The name of this log group. LogGroupName() *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 // Create a new Metric Filter on this Log Group. AddMetricFilter(id *string, props *MetricFilterOptions) MetricFilter // Create a new Log Stream for this Log Group. AddStream(id *string, props *StreamOptions) LogStream // Create a new Subscription Filter on this Log Group. AddSubscriptionFilter(id *string, props *SubscriptionFilterOptions) SubscriptionFilter // Adds a statement to the resource policy associated with this log group. // // A resource policy will be automatically created upon the first call to `addToResourcePolicy`. // // Any ARN Principals inside of the statement will be converted into AWS Account ID strings // because CloudWatch Logs Resource Policies do not accept ARN principals. AddToResourcePolicy(statement awsiam.PolicyStatement) *awsiam.AddToResourcePolicyResult // Apply the given removal policy to this resource. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). ApplyRemovalPolicy(policy awscdk.RemovalPolicy) // Extract a metric from structured log events in the LogGroup. // // Creates a MetricFilter on this LogGroup that will extract the value // of the indicated JSON field in all records where it occurs. // // The metric will be available in CloudWatch Metrics under the // indicated namespace and name. // // Returns: A Metric object representing the extracted metric. ExtractMetric(jsonField *string, metricNamespace *string, metricName *string) awscloudwatch.Metric 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 // Give the indicated permissions on this log group and all streams. Grant(grantee awsiam.IGrantable, actions ...*string) awsiam.Grant // Give permissions to create and write to streams in this log group. GrantWrite(grantee awsiam.IGrantable) awsiam.Grant // Public method to get the physical name of this log group. // // Returns: Physical name of log group. LogGroupPhysicalName() *string // Returns a string representation of this construct. ToString() *string }
Define a CloudWatch Log Group.
Example:
import logs "github.com/aws/aws-cdk-go/awscdk" logGroup := logs.NewLogGroup(this, jsii.String("Log Group")) logBucket := s3.NewBucket(this, jsii.String("S3 Bucket")) tasks.NewEmrContainersStartJobRun(this, jsii.String("EMR Containers Start Job Run"), &emrContainersStartJobRunProps{ virtualCluster: tasks.virtualClusterInput.fromVirtualClusterId(jsii.String("de92jdei2910fwedz")), releaseLabel: tasks.releaseLabel_EMR_6_2_0(), jobDriver: &jobDriver{ sparkSubmitJobDriver: &sparkSubmitJobDriver{ entryPoint: sfn.taskInput.fromText(jsii.String("local:///usr/lib/spark/examples/src/main/python/pi.py")), sparkSubmitParameters: jsii.String("--conf spark.executor.instances=2 --conf spark.executor.memory=2G --conf spark.executor.cores=2 --conf spark.driver.cores=1"), }, }, monitoring: &monitoring{ logGroup: logGroup, logBucket: logBucket, }, })
func NewLogGroup ¶
func NewLogGroup(scope constructs.Construct, id *string, props *LogGroupProps) LogGroup
type LogGroupProps ¶
type LogGroupProps struct { // The KMS Key to encrypt the log group with. EncryptionKey awskms.IKey `field:"optional" json:"encryptionKey" yaml:"encryptionKey"` // Name of the log group. LogGroupName *string `field:"optional" json:"logGroupName" yaml:"logGroupName"` // Determine the removal policy of this log group. // // Normally you want to retain the log group so you can diagnose issues // from logs even after a deployment that no longer includes the log group. // In that case, use the normal date-based retention policy to age out your // logs. RemovalPolicy awscdk.RemovalPolicy `field:"optional" json:"removalPolicy" yaml:"removalPolicy"` // How long, in days, the log contents will be retained. // // To retain all logs, set this value to RetentionDays.INFINITE. Retention RetentionDays `field:"optional" json:"retention" yaml:"retention"` }
Properties for a LogGroup.
Example:
var vpc vpc kmsKey := kms.NewKey(this, jsii.String("KmsKey")) // Pass the KMS key in the `encryptionKey` field to associate the key to the log group logGroup := logs.NewLogGroup(this, jsii.String("LogGroup"), &logGroupProps{ encryptionKey: kmsKey, }) // Pass the KMS key in the `encryptionKey` field to associate the key to the S3 bucket execBucket := s3.NewBucket(this, jsii.String("EcsExecBucket"), &bucketProps{ encryptionKey: kmsKey, }) cluster := ecs.NewCluster(this, jsii.String("Cluster"), &clusterProps{ vpc: vpc, executeCommandConfiguration: &executeCommandConfiguration{ kmsKey: kmsKey, logConfiguration: &executeCommandLogConfiguration{ cloudWatchLogGroup: logGroup, cloudWatchEncryptionEnabled: jsii.Boolean(true), s3Bucket: execBucket, s3EncryptionEnabled: jsii.Boolean(true), s3KeyPrefix: jsii.String("exec-command-output"), }, logging: ecs.executeCommandLogging_OVERRIDE, }, })
type LogRetention ¶
type LogRetention interface { constructs.Construct // The ARN of the LogGroup. LogGroupArn() *string // The tree node. Node() constructs.Node // Returns a string representation of this construct. ToString() *string }
Creates a custom resource to control the retention policy of a CloudWatch Logs log group.
The log group is created if it doesn't already exist. The policy is removed when `retentionDays` is `undefined` or equal to `Infinity`. Log group can be created in the region that is different from stack region by specifying `logGroupRegion`.
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" import "github.com/aws/aws-cdk-go/awscdk" var role role logRetention := awscdk.Aws_logs.NewLogRetention(this, jsii.String("MyLogRetention"), &logRetentionProps{ logGroupName: jsii.String("logGroupName"), retention: awscdk.*Aws_logs.retentionDays_ONE_DAY, // the properties below are optional logGroupRegion: jsii.String("logGroupRegion"), logRetentionRetryOptions: &logRetentionRetryOptions{ base: cdk.duration.minutes(jsii.Number(30)), maxRetries: jsii.Number(123), }, role: role, })
func NewLogRetention ¶
func NewLogRetention(scope constructs.Construct, id *string, props *LogRetentionProps) LogRetention
type LogRetentionProps ¶
type LogRetentionProps struct { // The log group name. LogGroupName *string `field:"required" json:"logGroupName" yaml:"logGroupName"` // The number of days log events are kept in CloudWatch Logs. Retention RetentionDays `field:"required" json:"retention" yaml:"retention"` // The region where the log group should be created. LogGroupRegion *string `field:"optional" json:"logGroupRegion" yaml:"logGroupRegion"` // Retry options for all AWS API calls. LogRetentionRetryOptions *LogRetentionRetryOptions `field:"optional" json:"logRetentionRetryOptions" yaml:"logRetentionRetryOptions"` // The IAM role for the Lambda function associated with the custom resource. Role awsiam.IRole `field:"optional" json:"role" yaml:"role"` }
Construction properties for a LogRetention.
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" import "github.com/aws/aws-cdk-go/awscdk" var role role logRetentionProps := &logRetentionProps{ logGroupName: jsii.String("logGroupName"), retention: awscdk.Aws_logs.retentionDays_ONE_DAY, // the properties below are optional logGroupRegion: jsii.String("logGroupRegion"), logRetentionRetryOptions: &logRetentionRetryOptions{ base: cdk.duration.minutes(jsii.Number(30)), maxRetries: jsii.Number(123), }, role: role, }
type LogRetentionRetryOptions ¶
type LogRetentionRetryOptions struct { // The base duration to use in the exponential backoff for operation retries. Base awscdk.Duration `field:"optional" json:"base" yaml:"base"` // The maximum amount of retries. MaxRetries *float64 `field:"optional" json:"maxRetries" yaml:"maxRetries"` }
Retry options for all AWS API calls.
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" logRetentionRetryOptions := &logRetentionRetryOptions{ base: cdk.duration.minutes(jsii.Number(30)), maxRetries: jsii.Number(123), }
type LogStream ¶
type LogStream interface { awscdk.Resource ILogStream // 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 name of this log stream. LogStreamName() *string // The tree node. Node() constructs.Node // Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource. // // This value will resolve to one of the following: // - a concrete value (e.g. `"my-awesome-bucket"`) // - `undefined`, when a name should be generated by CloudFormation // - a concrete name generated automatically during synthesis, in // cross-environment scenarios. PhysicalName() *string // The stack in which this resource is defined. Stack() awscdk.Stack // Apply the given removal policy to this resource. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). ApplyRemovalPolicy(policy awscdk.RemovalPolicy) GeneratePhysicalName() *string // Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`). // // Normally, this token will resolve to `arnAttr`, but if the resource is // referenced across environments, `arnComponents` will be used to synthesize // a concrete ARN with the resource's physical name. Make sure to reference // `this.physicalName` in `arnComponents`. GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string // Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`). // // Normally, this token will resolve to `nameAttr`, but if the resource is // referenced across environments, it will be resolved to `this.physicalName`, // which will be a concrete name. GetResourceNameAttribute(nameAttr *string) *string // Returns a string representation of this construct. ToString() *string }
Define a Log Stream in a Log Group.
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 logGroup logGroup logStream := awscdk.Aws_logs.NewLogStream(this, jsii.String("MyLogStream"), &logStreamProps{ logGroup: logGroup, // the properties below are optional logStreamName: jsii.String("logStreamName"), removalPolicy: cdk.removalPolicy_DESTROY, })
func NewLogStream ¶
func NewLogStream(scope constructs.Construct, id *string, props *LogStreamProps) LogStream
type LogStreamProps ¶
type LogStreamProps struct { // The log group to create a log stream for. LogGroup ILogGroup `field:"required" json:"logGroup" yaml:"logGroup"` // The name of the log stream to create. // // The name must be unique within the log group. LogStreamName *string `field:"optional" json:"logStreamName" yaml:"logStreamName"` // Determine what happens when the log stream resource is removed from the app. // // Normally you want to retain the log stream so you can diagnose issues from // logs even after a deployment that no longer includes the log stream. // // The date-based retention policy of your log group will age out the logs // after a certain time. RemovalPolicy awscdk.RemovalPolicy `field:"optional" json:"removalPolicy" yaml:"removalPolicy"` }
Properties for a LogStream.
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 logGroup logGroup logStreamProps := &logStreamProps{ logGroup: logGroup, // the properties below are optional logStreamName: jsii.String("logStreamName"), removalPolicy: cdk.removalPolicy_DESTROY, }
type LogSubscriptionDestinationConfig ¶
type LogSubscriptionDestinationConfig struct { // The ARN of the subscription's destination. Arn *string `field:"required" json:"arn" yaml:"arn"` // The role to assume to write log events to the destination. Role awsiam.IRole `field:"optional" json:"role" yaml:"role"` }
Properties returned by a Subscription destination.
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" import "github.com/aws/aws-cdk-go/awscdk" var role role logSubscriptionDestinationConfig := &logSubscriptionDestinationConfig{ arn: jsii.String("arn"), // the properties below are optional role: role, }
type MetricFilter ¶
type MetricFilter interface { awscdk.Resource // The environment this resource belongs to. // // For resources that are created and managed by the CDK // (generally, those created by creating new class instances like Role, Bucket, etc.), // this is always the same as the environment of the stack they belong to; // however, for imported resources // (those obtained from static methods like fromRoleArn, fromBucketName, etc.), // that might be different than the stack they were imported into. Env() *awscdk.ResourceEnvironment // The tree node. Node() constructs.Node // Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource. // // This value will resolve to one of the following: // - a concrete value (e.g. `"my-awesome-bucket"`) // - `undefined`, when a name should be generated by CloudFormation // - a concrete name generated automatically during synthesis, in // cross-environment scenarios. PhysicalName() *string // The 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 // Return the given named metric for this Metric Filter. Metric(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Returns a string representation of this construct. ToString() *string }
A filter that extracts information from CloudWatch Logs and emits to CloudWatch Metrics.
Example:
awscdk.NewMetricFilter(this, jsii.String("MetricFilter"), &metricFilterProps{ logGroup: logGroup, metricNamespace: jsii.String("MyApp"), metricName: jsii.String("Latency"), filterPattern: awscdk.FilterPattern.exists(jsii.String("$.latency")), metricValue: jsii.String("$.latency"), })
func NewMetricFilter ¶
func NewMetricFilter(scope constructs.Construct, id *string, props *MetricFilterProps) MetricFilter
type MetricFilterOptions ¶
type MetricFilterOptions struct { // Pattern to search for log events. FilterPattern IFilterPattern `field:"required" json:"filterPattern" yaml:"filterPattern"` // The name of the metric to emit. MetricName *string `field:"required" json:"metricName" yaml:"metricName"` // The namespace of the metric to emit. MetricNamespace *string `field:"required" json:"metricNamespace" yaml:"metricNamespace"` // The value to emit if the pattern does not match a particular event. DefaultValue *float64 `field:"optional" json:"defaultValue" yaml:"defaultValue"` // The value to emit for the metric. // // Can either be a literal number (typically "1"), or the name of a field in the structure // to take the value from the matched event. If you are using a field value, the field // value must have been matched using the pattern. // // If you want to specify a field from a matched JSON structure, use '$.fieldName', // and make sure the field is in the pattern (if only as '$.fieldName = *'). // // If you want to specify a field from a matched space-delimited structure, // use '$fieldName'. MetricValue *string `field:"optional" json:"metricValue" yaml:"metricValue"` }
Properties for a MetricFilter created from a LogGroup.
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 filterPattern iFilterPattern metricFilterOptions := &metricFilterOptions{ filterPattern: filterPattern, metricName: jsii.String("metricName"), metricNamespace: jsii.String("metricNamespace"), // the properties below are optional defaultValue: jsii.Number(123), metricValue: jsii.String("metricValue"), }
type MetricFilterProps ¶
type MetricFilterProps struct { // Pattern to search for log events. FilterPattern IFilterPattern `field:"required" json:"filterPattern" yaml:"filterPattern"` // The name of the metric to emit. MetricName *string `field:"required" json:"metricName" yaml:"metricName"` // The namespace of the metric to emit. MetricNamespace *string `field:"required" json:"metricNamespace" yaml:"metricNamespace"` // The value to emit if the pattern does not match a particular event. DefaultValue *float64 `field:"optional" json:"defaultValue" yaml:"defaultValue"` // The value to emit for the metric. // // Can either be a literal number (typically "1"), or the name of a field in the structure // to take the value from the matched event. If you are using a field value, the field // value must have been matched using the pattern. // // If you want to specify a field from a matched JSON structure, use '$.fieldName', // and make sure the field is in the pattern (if only as '$.fieldName = *'). // // If you want to specify a field from a matched space-delimited structure, // use '$fieldName'. MetricValue *string `field:"optional" json:"metricValue" yaml:"metricValue"` // The log group to create the filter on. LogGroup ILogGroup `field:"required" json:"logGroup" yaml:"logGroup"` }
Properties for a MetricFilter.
Example:
awscdk.NewMetricFilter(this, jsii.String("MetricFilter"), &metricFilterProps{ logGroup: logGroup, metricNamespace: jsii.String("MyApp"), metricName: jsii.String("Latency"), filterPattern: awscdk.FilterPattern.exists(jsii.String("$.latency")), metricValue: jsii.String("$.latency"), })
type QueryDefinition ¶ added in v2.21.0
type QueryDefinition interface { awscdk.Resource // The environment this resource belongs to. // // For resources that are created and managed by the CDK // (generally, those created by creating new class instances like Role, Bucket, etc.), // this is always the same as the environment of the stack they belong to; // however, for imported resources // (those obtained from static methods like fromRoleArn, fromBucketName, etc.), // that might be different than the stack they were imported into. Env() *awscdk.ResourceEnvironment // The tree node. Node() constructs.Node // Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource. // // This value will resolve to one of the following: // - a concrete value (e.g. `"my-awesome-bucket"`) // - `undefined`, when a name should be generated by CloudFormation // - a concrete name generated automatically during synthesis, in // cross-environment scenarios. PhysicalName() *string // The ID of the query definition. QueryDefinitionId() *string // The stack in which this resource is defined. Stack() awscdk.Stack // Apply the given removal policy to this resource. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). ApplyRemovalPolicy(policy awscdk.RemovalPolicy) GeneratePhysicalName() *string // Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`). // // Normally, this token will resolve to `arnAttr`, but if the resource is // referenced across environments, `arnComponents` will be used to synthesize // a concrete ARN with the resource's physical name. Make sure to reference // `this.physicalName` in `arnComponents`. GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string // Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`). // // Normally, this token will resolve to `nameAttr`, but if the resource is // referenced across environments, it will be resolved to `this.physicalName`, // which will be a concrete name. GetResourceNameAttribute(nameAttr *string) *string // Returns a string representation of this construct. ToString() *string }
Define a query definition for CloudWatch Logs Insights.
Example:
logs.NewQueryDefinition(this, jsii.String("QueryDefinition"), &queryDefinitionProps{ queryDefinitionName: jsii.String("MyQuery"), queryString: logs.NewQueryString(&queryStringProps{ fields: []*string{ jsii.String("@timestamp"), jsii.String("@message"), }, sort: jsii.String("@timestamp desc"), limit: jsii.Number(20), }), })
func NewQueryDefinition ¶ added in v2.21.0
func NewQueryDefinition(scope constructs.Construct, id *string, props *QueryDefinitionProps) QueryDefinition
type QueryDefinitionProps ¶ added in v2.21.0
type QueryDefinitionProps struct { // Name of the query definition. QueryDefinitionName *string `field:"required" json:"queryDefinitionName" yaml:"queryDefinitionName"` // The query string to use for this query definition. QueryString QueryString `field:"required" json:"queryString" yaml:"queryString"` // Specify certain log groups for the query definition. LogGroups *[]ILogGroup `field:"optional" json:"logGroups" yaml:"logGroups"` }
Properties for a QueryDefinition.
Example:
logs.NewQueryDefinition(this, jsii.String("QueryDefinition"), &queryDefinitionProps{ queryDefinitionName: jsii.String("MyQuery"), queryString: logs.NewQueryString(&queryStringProps{ fields: []*string{ jsii.String("@timestamp"), jsii.String("@message"), }, sort: jsii.String("@timestamp desc"), limit: jsii.Number(20), }), })
type QueryString ¶ added in v2.21.0
type QueryString interface { // String representation of this QueryString. ToString() *string }
Define a QueryString.
Example:
logs.NewQueryDefinition(this, jsii.String("QueryDefinition"), &queryDefinitionProps{ queryDefinitionName: jsii.String("MyQuery"), queryString: logs.NewQueryString(&queryStringProps{ fields: []*string{ jsii.String("@timestamp"), jsii.String("@message"), }, sort: jsii.String("@timestamp desc"), limit: jsii.Number(20), }), })
func NewQueryString ¶ added in v2.21.0
func NewQueryString(props *QueryStringProps) QueryString
type QueryStringProps ¶ added in v2.21.0
type QueryStringProps struct { // Specifies which fields to display in the query results. Display *string `field:"optional" json:"display" yaml:"display"` // Retrieves the specified fields from log events for display. Fields *[]*string `field:"optional" json:"fields" yaml:"fields"` // Filters the results of a query that's based on one or more conditions. Filter *string `field:"optional" json:"filter" yaml:"filter"` // Specifies the number of log events returned by the query. Limit *float64 `field:"optional" json:"limit" yaml:"limit"` // Extracts data from a log field and creates one or more ephemeral fields that you can process further in the query. Parse *string `field:"optional" json:"parse" yaml:"parse"` // Sorts the retrieved log events. Sort *string `field:"optional" json:"sort" yaml:"sort"` // Uses log field values to calculate aggregate statistics. Stats *string `field:"optional" json:"stats" yaml:"stats"` }
Properties for a QueryString.
Example:
logs.NewQueryDefinition(this, jsii.String("QueryDefinition"), &queryDefinitionProps{ queryDefinitionName: jsii.String("MyQuery"), queryString: logs.NewQueryString(&queryStringProps{ fields: []*string{ jsii.String("@timestamp"), jsii.String("@message"), }, sort: jsii.String("@timestamp desc"), limit: jsii.Number(20), }), })
type ResourcePolicy ¶
type ResourcePolicy interface { awscdk.Resource // The IAM policy document for this resource policy. Document() awsiam.PolicyDocument // The environment this resource belongs to. // // For resources that are created and managed by the CDK // (generally, those created by creating new class instances like Role, Bucket, etc.), // this is always the same as the environment of the stack they belong to; // however, for imported resources // (those obtained from static methods like fromRoleArn, fromBucketName, etc.), // that might be different than the stack they were imported into. Env() *awscdk.ResourceEnvironment // The tree node. Node() constructs.Node // Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource. // // This value will resolve to one of the following: // - a concrete value (e.g. `"my-awesome-bucket"`) // - `undefined`, when a name should be generated by CloudFormation // - a concrete name generated automatically during synthesis, in // cross-environment scenarios. PhysicalName() *string // The 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 }
Resource Policy for CloudWatch Log Groups.
Policies define the operations that are allowed on this resource.
You almost never need to define this construct directly.
All AWS resources that support resource policies have a method called `addToResourcePolicy()`, which will automatically create a new resource policy if one doesn't exist yet, otherwise it will add to the existing policy.
Prefer to use `addToResourcePolicy()` instead.
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" import "github.com/aws/aws-cdk-go/awscdk" var policyStatement policyStatement resourcePolicy := awscdk.Aws_logs.NewResourcePolicy(this, jsii.String("MyResourcePolicy"), &resourcePolicyProps{ policyStatements: []*policyStatement{ policyStatement, }, resourcePolicyName: jsii.String("resourcePolicyName"), })
func NewResourcePolicy ¶
func NewResourcePolicy(scope constructs.Construct, id *string, props *ResourcePolicyProps) ResourcePolicy
type ResourcePolicyProps ¶
type ResourcePolicyProps struct { // Initial statements to add to the resource policy. PolicyStatements *[]awsiam.PolicyStatement `field:"optional" json:"policyStatements" yaml:"policyStatements"` // Name of the log group resource policy. ResourcePolicyName *string `field:"optional" json:"resourcePolicyName" yaml:"resourcePolicyName"` }
Properties to define Cloudwatch log group resource policy.
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" import "github.com/aws/aws-cdk-go/awscdk" var policyStatement policyStatement resourcePolicyProps := &resourcePolicyProps{ policyStatements: []*policyStatement{ policyStatement, }, resourcePolicyName: jsii.String("resourcePolicyName"), }
type RetentionDays ¶
type RetentionDays string
How long, in days, the log contents will be retained.
Example:
import logs "github.com/aws/aws-cdk-go/awscdk" var myLogsPublishingRole role var vpc vpc // Exporting logs from a cluster cluster := rds.NewDatabaseCluster(this, jsii.String("Database"), &databaseClusterProps{ engine: rds.databaseClusterEngine.aurora(&auroraClusterEngineProps{ version: rds.auroraEngineVersion_VER_1_17_9(), }), instanceProps: &instanceProps{ vpc: vpc, }, cloudwatchLogsExports: []*string{ jsii.String("error"), jsii.String("general"), jsii.String("slowquery"), jsii.String("audit"), }, // Export all available MySQL-based logs cloudwatchLogsRetention: logs.retentionDays_THREE_MONTHS, // Optional - default is to never expire logs cloudwatchLogsRetentionRole: myLogsPublishingRole, }) // Exporting logs from an instance instance := rds.NewDatabaseInstance(this, jsii.String("Instance"), &databaseInstanceProps{ engine: rds.databaseInstanceEngine.postgres(&postgresInstanceEngineProps{ version: rds.postgresEngineVersion_VER_12_3(), }), vpc: vpc, cloudwatchLogsExports: []*string{ jsii.String("postgresql"), }, })
const ( // 1 day. RetentionDays_ONE_DAY RetentionDays = "ONE_DAY" // 3 days. RetentionDays_THREE_DAYS RetentionDays = "THREE_DAYS" // 5 days. RetentionDays_FIVE_DAYS RetentionDays = "FIVE_DAYS" // 1 week. RetentionDays_ONE_WEEK RetentionDays = "ONE_WEEK" // 2 weeks. RetentionDays_TWO_WEEKS RetentionDays = "TWO_WEEKS" // 1 month. RetentionDays_ONE_MONTH RetentionDays = "ONE_MONTH" // 2 months. RetentionDays_TWO_MONTHS RetentionDays = "TWO_MONTHS" // 3 months. RetentionDays_THREE_MONTHS RetentionDays = "THREE_MONTHS" // 4 months. RetentionDays_FOUR_MONTHS RetentionDays = "FOUR_MONTHS" // 5 months. RetentionDays_FIVE_MONTHS RetentionDays = "FIVE_MONTHS" // 6 months. RetentionDays_SIX_MONTHS RetentionDays = "SIX_MONTHS" // 1 year. RetentionDays_ONE_YEAR RetentionDays = "ONE_YEAR" // 13 months. RetentionDays_THIRTEEN_MONTHS RetentionDays = "THIRTEEN_MONTHS" // 18 months. RetentionDays_EIGHTEEN_MONTHS RetentionDays = "EIGHTEEN_MONTHS" // 2 years. RetentionDays_TWO_YEARS RetentionDays = "TWO_YEARS" // 5 years. RetentionDays_FIVE_YEARS RetentionDays = "FIVE_YEARS" // 6 years. RetentionDays_SIX_YEARS RetentionDays = "SIX_YEARS" // 7 years. RetentionDays_SEVEN_YEARS RetentionDays = "SEVEN_YEARS" // 8 years. RetentionDays_EIGHT_YEARS RetentionDays = "EIGHT_YEARS" // 9 years. RetentionDays_NINE_YEARS RetentionDays = "NINE_YEARS" // 10 years. RetentionDays_TEN_YEARS RetentionDays = "TEN_YEARS" // Retain logs forever. RetentionDays_INFINITE RetentionDays = "INFINITE" )
type SpaceDelimitedTextPattern ¶
type SpaceDelimitedTextPattern interface { IFilterPattern LogPatternString() *string // Restrict where the pattern applies. WhereNumber(columnName *string, comparison *string, value *float64) SpaceDelimitedTextPattern // Restrict where the pattern applies. WhereString(columnName *string, comparison *string, value *string) SpaceDelimitedTextPattern }
Space delimited text pattern.
Example:
// Search for all events where the component is "HttpServer" and the // result code is not equal to 200. pattern := logs.filterPattern.spaceDelimited(jsii.String("time"), jsii.String("component"), jsii.String("..."), jsii.String("result_code"), jsii.String("latency")).whereString(jsii.String("component"), jsii.String("="), jsii.String("HttpServer")).whereNumber(jsii.String("result_code"), jsii.String("!="), jsii.Number(200))
func FilterPattern_SpaceDelimited ¶
func FilterPattern_SpaceDelimited(columns ...*string) SpaceDelimitedTextPattern
A space delimited log pattern matcher.
The log event is divided into space-delimited columns (optionally enclosed by "" or [] to capture spaces into column values), and names are given to each column.
'...' may be specified once to match any number of columns.
Afterwards, conditions may be added to individual columns.
func NewSpaceDelimitedTextPattern ¶
func NewSpaceDelimitedTextPattern(columns *[]*string, restrictions *map[string]*[]*ColumnRestriction) SpaceDelimitedTextPattern
func SpaceDelimitedTextPattern_Construct ¶
func SpaceDelimitedTextPattern_Construct(columns *[]*string) SpaceDelimitedTextPattern
Construct a new instance of a space delimited text pattern.
Since this class must be public, we can't rely on the user only creating it through the `LogPattern.spaceDelimited()` factory function. We must therefore validate the argument in the constructor. Since we're returning a copy on every mutation, and we don't want to re-validate the same things on every construction, we provide a limited set of mutator functions and only validate the new data every time.
type StreamOptions ¶
type StreamOptions struct { // The name of the log stream to create. // // The name must be unique within the log group. LogStreamName *string `field:"optional" json:"logStreamName" yaml:"logStreamName"` }
Properties for a new LogStream created from a LogGroup.
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" streamOptions := &streamOptions{ logStreamName: jsii.String("logStreamName"), }
type SubscriptionFilter ¶
type SubscriptionFilter interface { awscdk.Resource // The environment this resource belongs to. // // For resources that are created and managed by the CDK // (generally, those created by creating new class instances like Role, Bucket, etc.), // this is always the same as the environment of the stack they belong to; // however, for imported resources // (those obtained from static methods like fromRoleArn, fromBucketName, etc.), // that might be different than the stack they were imported into. Env() *awscdk.ResourceEnvironment // The tree node. Node() constructs.Node // Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource. // // This value will resolve to one of the following: // - a concrete value (e.g. `"my-awesome-bucket"`) // - `undefined`, when a name should be generated by CloudFormation // - a concrete name generated automatically during synthesis, in // cross-environment scenarios. PhysicalName() *string // The stack in which this resource is defined. Stack() awscdk.Stack // Apply the given removal policy to this resource. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). ApplyRemovalPolicy(policy awscdk.RemovalPolicy) GeneratePhysicalName() *string // Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`). // // Normally, this token will resolve to `arnAttr`, but if the resource is // referenced across environments, `arnComponents` will be used to synthesize // a concrete ARN with the resource's physical name. Make sure to reference // `this.physicalName` in `arnComponents`. GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string // Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`). // // Normally, this token will resolve to `nameAttr`, but if the resource is // referenced across environments, it will be resolved to `this.physicalName`, // which will be a concrete name. GetResourceNameAttribute(nameAttr *string) *string // Returns a string representation of this construct. ToString() *string }
A new Subscription on a CloudWatch log group.
Example:
import destinations "github.com/aws/aws-cdk-go/awscdk" var fn function var logGroup logGroup logs.NewSubscriptionFilter(this, jsii.String("Subscription"), &subscriptionFilterProps{ logGroup: logGroup, destination: destinations.NewLambdaDestination(fn), filterPattern: logs.filterPattern.allTerms(jsii.String("ERROR"), jsii.String("MainThread")), })
func NewSubscriptionFilter ¶
func NewSubscriptionFilter(scope constructs.Construct, id *string, props *SubscriptionFilterProps) SubscriptionFilter
type SubscriptionFilterOptions ¶
type SubscriptionFilterOptions struct { // The destination to send the filtered events to. // // For example, a Kinesis stream or a Lambda function. Destination ILogSubscriptionDestination `field:"required" json:"destination" yaml:"destination"` // Log events matching this pattern will be sent to the destination. FilterPattern IFilterPattern `field:"required" json:"filterPattern" yaml:"filterPattern"` }
Properties for a new SubscriptionFilter created from a LogGroup.
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 filterPattern iFilterPattern var logSubscriptionDestination iLogSubscriptionDestination subscriptionFilterOptions := &subscriptionFilterOptions{ destination: logSubscriptionDestination, filterPattern: filterPattern, }
type SubscriptionFilterProps ¶
type SubscriptionFilterProps struct { // The destination to send the filtered events to. // // For example, a Kinesis stream or a Lambda function. Destination ILogSubscriptionDestination `field:"required" json:"destination" yaml:"destination"` // Log events matching this pattern will be sent to the destination. FilterPattern IFilterPattern `field:"required" json:"filterPattern" yaml:"filterPattern"` // The log group to create the subscription on. LogGroup ILogGroup `field:"required" json:"logGroup" yaml:"logGroup"` }
Properties for a SubscriptionFilter.
Example:
import destinations "github.com/aws/aws-cdk-go/awscdk" var fn function var logGroup logGroup logs.NewSubscriptionFilter(this, jsii.String("Subscription"), &subscriptionFilterProps{ logGroup: logGroup, destination: destinations.NewLambdaDestination(fn), filterPattern: logs.filterPattern.allTerms(jsii.String("ERROR"), jsii.String("MainThread")), })