@@ -21,9 +21,9 @@ the :py:class:`@aws-cdk/aws-sns.Topic` construct can be used to define SNS
21
21
Topics, etc.
22
22
23
23
Under the hood, these constructs are implemented using CloudFormation resources,
24
- which are available under the **cloudformation ** namespace of each library. For
24
+ which are available under the **CfnXxx ** classes in each library. For
25
25
example, the :py:class: `@aws-cdk/aws-s3.Bucket ` construct uses the
26
- :py:class: `@aws-cdk/aws-s3.cloudformation.BucketResource ` resource (as well as
26
+ :py:class: `@aws-cdk/aws-s3.CfnBucket ` resource (as well as
27
27
other resources, depending on what bucket APIs are used).
28
28
29
29
.. important ::
@@ -39,7 +39,7 @@ Resources
39
39
CloudFormation resource classes are automatically generated from the `AWS
40
40
CloudFormation Resource Specification
41
41
<https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-resource-specification.html> `_
42
- and available under the **cloudformation ** namespace of each AWS library. Their
42
+ and available under the **CfnXxx ** classes of each AWS library. Their
43
43
API matches 1:1 with how you would use these resources in CloudFormation.
44
44
45
45
When defining CloudFormation resource, the **props ** argument of the class
@@ -51,11 +51,11 @@ resource encrypted with an AWS managed key you can directly specify the
51
51
`KmsMasterKeyId <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sqs-queues.html#aws-sqs-queue-kmsmasterkeyid >`_
52
52
property.
53
53
54
- .. code-block :: js
54
+ .. code-block :: ts
55
55
56
- import { cloudformation } from ' @aws-cdk/aws-sqs' ;
56
+ import sqs = require( '@aws-cdk/aws-sqs') ;
57
57
58
- new cloudformation.QueueResource (this , ' MyQueueResource' , {
58
+ new sqs.CfnQueue (this, 'MyQueueResource', {
59
59
kmsMasterKeyId: 'alias/aws/sqs'
60
60
});
61
61
@@ -82,14 +82,14 @@ use one of the properties available on the resource object.
82
82
The following example configures a |LAM | function's dead letter queue to use a
83
83
the ARN of an |SQS | queue resource.
84
84
85
- .. code-block :: js
85
+ .. code-block :: ts
86
86
87
- import { cloudformation as sqscfn } from ' @aws-cdk/aws-sqs' ;
88
- import { cloudformation as lambdacfn } from ' @aws-cdk/aws-lambda' ;
87
+ import sqs = require( '@aws-cdk/aws-sqs') ;
88
+ import lambda = require( '@aws-cdk/aws-lambda') ;
89
89
90
- const dlq = new sqscfn.QueueResource (this , { name: ' DLQ' });
90
+ const dlq = new sqs.CfnQueue (this, { name: 'DLQ' });
91
91
92
- new lambdacfn.FunctionResource (this , {
92
+ new lambda.CfnFunction (this, {
93
93
deadLetterConfig: {
94
94
targetArn: dlq.queueArn
95
95
}
@@ -118,13 +118,13 @@ Parameters
118
118
119
119
.. NEEDS SOME INTRO TEXT
120
120
121
- .. code-block :: js
121
+ .. code-block :: ts
122
122
123
- import { cloudformation } from ' @aws-cdk/aws-sns' ;
123
+ import sns = require( '@aws-cdk/aws-sns') ;
124
124
import cdk = require('@aws-cdk/cdk');
125
125
126
126
const p = new cdk.Parameter(this, 'MyParam', { type: 'String' });
127
- new cloudformation.TopicResource (this , ' MyTopic' , { displayName: p .ref });
127
+ new sns.CfnTopic (this, 'MyTopic', { displayName: p.ref });
128
128
129
129
.. _outputs :
130
130
@@ -135,10 +135,10 @@ Outputs
135
135
136
136
.. code-block :: js
137
137
138
- import { cloudformation } from ' @aws-cdk/aws-sqs' ;
138
+ import sqs = require( ' @aws-cdk/aws-sqs' ) ;
139
139
import cdk = require(' @aws-cdk/cdk' );
140
140
141
- const queue = new cloudformation.QueueResource (this , ' MyQueue' );
141
+ const queue = new sqs.CfnQueue (this , ' MyQueue' );
142
142
const out = new cdk.Output (this , ' MyQueueArn' , { value: queue .queueArn });
143
143
144
144
const import = out .makeImportValue ();
@@ -153,13 +153,13 @@ Conditions
153
153
154
154
.. code - block:: js
155
155
156
- import { cloudformation } from ' @aws-cdk/aws-sqs' ;
156
+ import sqs = require( ' @aws-cdk/aws-sqs' ) ;
157
157
import cdk = require(' @aws-cdk/cdk' );
158
158
const cond = new cdk.Condition (this , ' MyCondition' , {
159
159
expression: new cdk.FnIf (... )
160
160
});
161
161
162
- const queue = new cloudformation.QueueResource (this , ' MyQueue' );
162
+ const queue = new sqs.CfnQueue (this , ' MyQueue' );
163
163
queue .options .condition = cond;
164
164
165
165
.. _intrinsic_functions :
0 commit comments