pulumi / pulumi-aws

An Amazon Web Services (AWS) Pulumi resource package, providing multi-language access to AWS
Apache License 2.0
428 stars 151 forks source link

Node Overlay Inventory #4007

Open t0yv0 opened 1 month ago

t0yv0 commented 1 month ago

As of v6.38.0 version of the provider, Node SDK carries these overlays

ARN Helpers

./arn.ts                         # type ARN = string | ManagedPolicy

IAM Helpers

./iam/documents.ts               # interface PolicyDocument, PolicyStatement, Conditions; function assumeRolePolicyForPrincipal
./iam/principals.ts              # Principals.AthenaPrincipal etc constants; not deprecated

Serverless Connectors

./cloudwatch/eventRuleMixins.ts  # EventRule.onEvent ; class EventRuleEventSubscription extends lambda.EventSubscription
./cloudwatch/logGroupMixins.ts   # LogGroup.onEvent  ; class LogGroupEventSubscription extends lambda.EventSubscription
./dynamodb/dynamodbMixins.ts     # Table.onEvent     ; class TableEventSubscription extends lambda.EventSubscription
./kinesis/kinesisMixins.ts       # Stream.onEvent; StreamEventSubscription
./lambda/lambdaMixins.ts         # CallbackFunction, EventSubscription
./s3/s3Mixins.ts                 # Bucket.onObjectCreated, Bucket.onObjectRemoved, Bucket.onEvent, BucketEventSubscription
./sns/snsMixins.ts               # Topic.onEvent
./sqs/sqsMixins.ts               # Queue.onEvent
./cloudwatch/cloudwatchMixins.ts # function onSchedule()

Interfaces

Would be good to understand how/where these are used?

./ecr/lifecyclePolicyDocument.ts  # interfaces: LifeCyclePolicyDocument, PolicyRule, Selection, Action
./ecs/container.ts                # lots of interfaces: SystemControl, Secret, ResourceRequirements etc
./s3/routingRules.ts              # interfaces Condition, RoutineRule, Redirect
./sqs/redrive.ts                  # interface RedrivePolicy
./tags.ts                         # interface Tags

Miscellany

./utils.ts.          # type Overwrite
./config/require.ts  # function requireRegion(): Region

Deprecated enum value overlays

./alb/ipAddressType.ts                         # deprecated IpAddressType.IpV4 etc
./alb/loadBalancerType.ts                      # deprecated AplicationLoadBalancer: LoadBalancerType
./applicationloadbalancing/ipAddressType.ts    # deprecated IpAddressType
./applicationloadbalancing/loadBalancerType.ts # deprecated ApplicationLoadBalancer
./autoscaling/metrics.ts                       # deprecated GroupMinSizeMetric etc
./autoscaling/notificationType.ts              # deprecated InstanceLaunchNotification etc
./ec2/instancePlatform.ts
./ec2/instanceType.ts
./ec2/placementStrategy.ts
./ec2/protocolType.ts
./ec2/tenancy.ts
./iam/managedPolicies.ts
./lambda/runtimes.ts
./rds/engineMode.ts
./rds/engineType.ts
./rds/instanceType.ts
./rds/storageType.ts
./region.ts
./route53/recordType.ts
./s3/cannedAcl.ts
./ssm/parameterType.ts
flostadler commented 1 week ago

I'm currently investigating how we could document overlay resources as part of pulumi/pulumi#13231. The possible avenues I see are documenting the overlays themselves and replacing them with native provider resources (e.g. MLCs). We can ignore the enum value overlays for now because they've already schematized and the overlays are deprecated.

As mentioned in https://github.com/pulumi/pulumi/issues/13231 we should be able to schematize overlays except resource methods once we have a customizable language chooser. I had a look through all overlay resources, methods and interfaces and they should be schematizable except the serverless mixins (they're resource methods).

We wanted to experiment with schematizing the underlying components of the serverless mixins and turning them into MLCs, but I found a problem with that. They use lambda.CallbackFunction under the hood which is node exclusive because there's no real alternatives in other languages (see https://github.com/pulumi/pulumi/issues/3820). If we wanted to turn those components into MLCs we'd have to remove the references to CallbackFunction and just use a regular lambda.Function. Which would be a breaking change.

@t0yv0 Can we in some way specialize a parameter type for one SDK using overlays? I'll experiment a bit with that to see if I can make this work.

flostadler commented 1 week ago

I experimented with specializing the the parameter types for one SDK using overlays and that should be possible with overloading.

There's one limitation though, resource methods do not support MultiArgumentInputs yet (see). It always generates a single object argument which doesn't allow matching the existing resource method overlays (e.g. Bucket.onObjectCreated). That would be a breaking change for the existing resource methods.