Class CustomResourceProps
(deprecated) Properties to provide a Lambda-backed custom resource.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.CloudFormation
Assembly: Amazon.CDK.AWS.CloudFormation.dll
Syntax (csharp)
public class CustomResourceProps : Object, ICustomResourceProps
Syntax (vb)
Public Class CustomResourceProps
Inherits Object
Implements ICustomResourceProps
Remarks
Stability: Deprecated
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.CloudFormation;
using Amazon.CDK;
CustomResourceProvider customResourceProvider;
var properties;
var customResourceProps = new CustomResourceProps {
Provider = customResourceProvider,
// the properties below are optional
Properties = new Dictionary<string, object> {
{ "propertiesKey", properties }
},
RemovalPolicy = RemovalPolicy.DESTROY,
ResourceType = "resourceType"
};
Synopsis
Constructors
CustomResourceProps() |
Properties
Properties | (deprecated) Properties to pass to the Lambda. |
Provider | (deprecated) The provider which implements the custom resource. |
RemovalPolicy | (deprecated) The policy to apply when this resource is removed from the application. |
ResourceType | (deprecated) For custom resources, you can specify AWS::CloudFormation::CustomResource (the default) as the resource type, or you can specify your own resource type name. |
Constructors
CustomResourceProps()
public CustomResourceProps()
Properties
Properties
(deprecated) Properties to pass to the Lambda.
public IDictionary<string, object> Properties { get; set; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Remarks
Default: - No properties.
Stability: Deprecated
Provider
(deprecated) The provider which implements the custom resource.
public ICustomResourceProvider Provider { get; set; }
Property Value
Remarks
You can implement a provider by listening to raw AWS CloudFormation events through an SNS topic or an AWS Lambda function or use the CDK's custom resource provider framework which makes it easier to implement robust providers.
using Amazon.CDK.CustomResources;
using Amazon.CDK.AWS.Lambda;
using Amazon.CDK;
Function myOnEventLambda;
Function myIsCompleteLambda;
var stack = new Stack();
var provider = new Provider(stack, "myProvider", new ProviderProps {
OnEventHandler = myOnEventLambda,
IsCompleteHandler = myIsCompleteLambda
});
using Amazon.CDK.AWS.CloudFormation;
using Amazon.CDK.AWS.Lambda;
Function myFunction;
// invoke an AWS Lambda function when a lifecycle event occurs:
var provider = CustomResourceProvider.FromLambda(myFunction);
using Amazon.CDK.AWS.CloudFormation;
using Amazon.CDK.AWS.SNS;
Topic myTopic;
// publish lifecycle events to an SNS topic:
var provider = CustomResourceProvider.FromTopic(myTopic);
Stability: Deprecated
RemovalPolicy
(deprecated) The policy to apply when this resource is removed from the application.
public Nullable<RemovalPolicy> RemovalPolicy { get; set; }
Property Value
System.Nullable<RemovalPolicy>
Remarks
Default: cdk.RemovalPolicy.Destroy
Stability: Deprecated
ResourceType
(deprecated) For custom resources, you can specify AWS::CloudFormation::CustomResource (the default) as the resource type, or you can specify your own resource type name.
public string ResourceType { get; set; }
Property Value
System.String
Remarks
For example, you can use "Custom::MyCustomResourceTypeName".
Custom resource type names must begin with "Custom::" and can include alphanumeric characters and the following characters: _@-. You can specify a custom resource type name up to a maximum length of 60 characters. You cannot change the type during an update.
Using your own resource type names helps you quickly differentiate the types of custom resources in your stack. For example, if you had two custom resources that conduct two different ping tests, you could name their type as Custom::PingTester to make them easily identifiable as ping testers (instead of using AWS::CloudFormation::CustomResource).
Default: - AWS::CloudFormation::CustomResource
Stability: Deprecated