@pulumi/cdk • Docs
The Pulumi provider to read the schema from
Enumeration Member | Value | Defined in |
---|---|---|
AWS_NATIVE |
"aws-native" |
types.ts:62 |
A Pulumi CDK App component. This is the entrypoint to your Pulumi CDK application. The second argument is a callback function where all CDK resources must be created.
import * as s3 from 'aws-cdk-lib/aws-s3';
import * as pulumicdk from '@pulumi/cdk';
const app = new pulumicdk.App('app', (scope: pulumicdk.App): pulumicdk.AppOutputs => {
// All resources must be created within a Pulumi Stack
const stack = new pulumicdk.Stack(scope, 'pulumi-stack');
const bucket = new s3.Bucket(stack, 'my-bucket');
return {
bucket: stack.asOutput(bucket.bucketName),
};
});
export const bucket = app.outputs['bucket'];
ComponentResource
<AppResource
>
ICloudAssemblyDirectoryProducer
AppComponent
new App(
id
,createFunc
,props
?):App
Parameter | Type |
---|---|
id |
string |
createFunc |
(scope ) => void | AppOutputs |
props ? |
AppResourceOptions |
pulumi.ComponentResource<AppResource>.constructor
Property | Modifier | Type | Default value | Description | Defined in |
---|---|---|---|---|---|
name |
readonly |
string |
undefined |
The name of the component | stack.ts:57 |
outputs |
public |
object |
{} |
The collection of outputs from the AWS CDK Stack represented as Pulumi Outputs. Each CfnOutput defined in the AWS CDK Stack will populate a value in the outputs. | stack.ts:63 |
get env():
Environment
This can be used to get the CDK Environment based on the Pulumi Provider used for the App. You can then use this to configure an explicit environment on Stacks.
const app = new pulumicdk.App('app', (scope: pulumicdk.App) => {
const stack = new pulumicdk.Stack(scope, 'pulumi-stack', {
props: { env: app.env },
});
});
Environment
the CDK Environment configured for the App
A Construct that represents an AWS CDK stack deployed with Pulumi.
In order to deploy a CDK stack with Pulumi, it must derive from this class.
Stack
new Stack(
app
,name
,options
?):Stack
Create and register an AWS CDK stack deployed with Pulumi.
Parameter | Type | Description |
---|---|---|
app |
App |
- |
name |
string |
The unique name of the resource. |
options ? |
StackOptions |
A bag of options that control this resource's behavior. |
cdk.Stack.constructor
asOutput<
T
>(v
):Output
<Unwrap
<T
>>
Convert a CDK value to a Pulumi Output.
Type Parameter |
---|
T |
Parameter | Type | Description |
---|---|---|
v |
T |
A CDK value. |
Output
<Unwrap
<T
>>
A Pulumi Output value.
AppComponent is the interface representing the Pulumi CDK App Component Resource
Property | Modifier | Type | Description | Defined in |
---|---|---|---|---|
name |
readonly |
string |
The name of the component | types.ts:72 |
Options for creating a Pulumi CDK App Component
Property | Type | Description | Defined in |
---|---|---|---|
appId? |
string |
A unique identifier for the application that the asset staging stack belongs to. This identifier will be used in the name of staging resources created for this application, and should be unique across apps. The identifier should include lowercase characters, numbers, periods (.) and dashes ('-') only and have a maximum of 17 characters. Default - generated from the pulumi project and stack name |
types.ts:25 |
props? |
AppProps |
Specify the CDK Stack properties to asociate with the stack. | types.ts:12 |
optional
remapCloudControlResource(logicalId
,typeName
,props
,options
):undefined
|ResourceMapping
Defines a mapping to override and/or provide an implementation for a CloudFormation resource type that is not (yet) implemented in the AWS Cloud Control API (and thus not yet available in the Pulumi AWS Native provider). Pulumi code can override this method to provide a custom mapping of CloudFormation elements and their properties into Pulumi CustomResources, commonly by using the AWS Classic provider to implement the missing resource.
Parameter | Type | Description |
---|---|---|
logicalId |
string |
The logical ID of the resource being mapped. |
typeName |
string |
The CloudFormation type name of the resource being mapped. |
props |
any |
The bag of input properties to the CloudFormation resource being mapped. |
options |
ResourceOptions |
The set of Pulumi ResourceOptions to apply to the resource being mapped. |
undefined
| ResourceMapping
An object containing one or more logical IDs mapped to Pulumi resources that must be created to implement the mapped CloudFormation resource, or else undefined if no mapping is implemented.
Options specific to the Pulumi CDK App component.
ComponentResourceOptions
Property | Type | Defined in |
---|---|---|
appOptions? |
AppOptions |
types.ts:54 |
Options for creating a Pulumi CDK Stack
Any Pulumi resource options provided at the Stack level will override those configured at the App level
new App('testapp', (scope: App) => {
// This stack will inherit the options from the App
new Stack(scope, 'teststack1');
// Override the options for this stack
new Stack(scope, 'teststack', {
providers: [
new native.Provider('custom-provider', { region: 'us-east-1' }),
],
props: { env: { region: 'us-east-1' } },
})
}, {
providers: [
new native.Provider('app-provider', { region: 'us-west-2' }),
]
})
ComponentResourceOptions
Property | Type | Description | Defined in |
---|---|---|---|
props? |
StackProps |
The CDK Stack props | stack.ts:297 |
AppOutputs:
object
[outputId
: string
]: pulumi.Output
<any
>
asList(
o
):string
[]
Convert a Pulumi Output to a list of CDK string values.
Parameter | Type | Description |
---|---|---|
o |
Output <string []> |
A Pulumi Output value which represents a list of strings. |
string
[]
A CDK token representing a list of string values.
asNumber(
o
):number
Convert a Pulumi Output to a CDK number value.
Parameter | Type | Description |
---|---|---|
o |
OutputInstance <number > |
A Pulumi Output value which represents a number. |
number
A CDK token representing a number value.
asString(
o
):string
Convert a Pulumi Output to a CDK string value.
Parameter | Type | Description |
---|---|---|
o |
Output <string > |
A Pulumi Output value which represents a string. |
string
A CDK token representing a string value.