Possible to extend provider/Custom resource #7575
-
Apologies if this is the wrong place to ask, I'm looking to create a AWS resource with an API that doesn't exist in pulumi or in the upstream terraform provider yet [1] [2] [3] was wondering if there was a way for now to use the AWS API and create a type SubnetNetworkAclAssociationArgs() =
inherit ResourceArgs()
[<Input("vpcId", required = true)>]
member val VpcId: Input<string> = null with get, set
[<Input("subnetId", required = true)>]
member val SubnetId: Input<string> = null with get, set
//[<AwsResourceType("aws:ec2/subnetNetworkAclAssociation:SubnetNetworkAclAssociation")>]
type SubnetNetworkAclAssociation(name: string, args: SubnetNetworkAclAssociationArgs, options) =
inherit CustomResource("aws:ec2/subnetNetworkAclAssociation:SubnetNetworkAclAssociation", name, args, options)
(* On Create? or some lifecycle hook? *)
let client = AmazonEC2Client()
// Get current associationId from subnet..
let req = ReplaceNetworkAclAssociationRequest(AssociationId = "", NetworkAclId = "")
client.ReplaceNetworkAclAssociationAsync(req)
(* On Delete *) ..
I'm assuming not :( but holding out a little hope 🙂 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Sorry for the delayed answer! For this specific resource, we've got it in the AWS Native provider, and you can have both native provider and classic provider calls that interact well in the same program. However, to your specific question about getting something that's not in the provider yet, the ideal way is creating a dynamic provider. Unfortunately, dynamic providers aren't available in C#/F# just yet; but if you're comfortable enough to write in TypeScript, JavaScript, or Python, you could wrap the API in a dynamic provider and get all of the state management goodness. |
Beta Was this translation helpful? Give feedback.
Sorry for the delayed answer! For this specific resource, we've got it in the AWS Native provider, and you can have both native provider and classic provider calls that interact well in the same program. However, to your specific question about getting something that's not in the provider yet, the ideal way is creating a dynamic provider. Unfortunately, dynamic providers aren't available in C#/F# just yet; but if you're comfortable enough to write in TypeScript, JavaScript, or Python, you could wrap the API in a dynamic provider and get all of the state management goodness.