nomoss 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +5 -15
  3. package/ROADMAP.md +2 -0
  4. package/docs/README.md +1 -1
  5. package/docs/application/aws-resource-coverage.md +26 -0
  6. package/docs/application/aws-resource-lifecycle-management.md +13 -23
  7. package/docs/application/cli-workflow.md +1 -1
  8. package/docs/application/engine-design.md +2 -2
  9. package/docs/application/generation-architecture.md +10 -45
  10. package/docs/application/resource-command-policy-stage.md +2 -2
  11. package/docs/application/resource-graph.md +1 -1
  12. package/docs/application/resource-lifecycle-tracker.md +1 -9
  13. package/docs/application/resource-mapping.md +4 -9
  14. package/docs/application/resource-operations.md +4 -2
  15. package/docs/application/tracing.md +2 -6
  16. package/docs/development/code-documentation.md +2 -0
  17. package/docs/development/effect-native-development.md +44 -0
  18. package/docs/development/linting.md +1 -1
  19. package/docs/development/review-code.md +22 -6
  20. package/docs/development/review-remediation-spec.md +28 -37
  21. package/docs/development/spec-writing.md +1 -1
  22. package/docs/development/testing.md +23 -9
  23. package/docs/operations/observability-sop.md +11 -17
  24. package/docs/operations/releasing.md +3 -1
  25. package/examples/README.md +3 -26
  26. package/examples/commands.ts +2 -36
  27. package/examples/queue/application.ts +8 -2
  28. package/examples/state-machine/application.ts +3 -1
  29. package/package.json +40 -46
  30. package/providers/aws/README.md +21 -0
  31. package/providers/aws/awsEnvironment.ts +114 -0
  32. package/providers/aws/generated/managementRegistry.ts +136 -0
  33. package/{src/providers/aws/resources/generated/native/apigatewayv2/api/index.ts → providers/aws/generated/resources/apigatewayv2/api.ts} +13 -50
  34. package/{src/providers/aws/resources/generated/native/apigatewayv2/integration/index.ts → providers/aws/generated/resources/apigatewayv2/integration.ts} +13 -37
  35. package/{src/providers/aws/resources/generated/native/apigatewayv2/route/index.ts → providers/aws/generated/resources/apigatewayv2/route.ts} +23 -40
  36. package/{src/providers/aws/resources/generated/native/apigatewayv2/stage/index.ts → providers/aws/generated/resources/apigatewayv2/stage.ts} +13 -38
  37. package/providers/aws/generated/resources/iam/accesskey.ts +184 -0
  38. package/{src/providers/aws/resources/generated/native/iam/group/index.ts → providers/aws/generated/resources/iam/group.ts} +13 -38
  39. package/{src/providers/aws/resources/generated/native/iam/grouppolicy/index.ts → providers/aws/generated/resources/iam/grouppolicy.ts} +29 -59
  40. package/{src/providers/aws/resources/generated/native/iam/instanceprofile/index.ts → providers/aws/generated/resources/iam/instanceprofile.ts} +13 -41
  41. package/{src/providers/aws/resources/generated/native/iam/managedpolicy/index.ts → providers/aws/generated/resources/iam/managedpolicy.ts} +13 -95
  42. package/providers/aws/generated/resources/iam/oidcprovider.ts +314 -0
  43. package/{src/providers/aws/resources/generated/native/iam/policy/index.ts → providers/aws/generated/resources/iam/policy.ts} +13 -28
  44. package/{src/providers/aws/resources/generated/native/iam/role/index.ts → providers/aws/generated/resources/iam/role.ts} +13 -47
  45. package/{src/providers/aws/resources/generated/native/iam/rolepolicy/index.ts → providers/aws/generated/resources/iam/rolepolicy.ts} +29 -59
  46. package/providers/aws/generated/resources/iam/samlprovider.ts +463 -0
  47. package/providers/aws/generated/resources/iam/servercertificate.ts +465 -0
  48. package/providers/aws/generated/resources/iam/servicelinkedrole.ts +187 -0
  49. package/{src/providers/aws/resources/generated/native/iam/user/index.ts → providers/aws/generated/resources/iam/user.ts} +13 -38
  50. package/{src/providers/aws/resources/generated/native/iam/userpolicy/index.ts → providers/aws/generated/resources/iam/userpolicy.ts} +29 -59
  51. package/{src/providers/aws/resources/generated/native/iam/usertogroupaddition/index.ts → providers/aws/generated/resources/iam/usertogroupaddition.ts} +13 -27
  52. package/providers/aws/generated/resources/iam/virtualmfadevice.ts +298 -0
  53. package/{src/providers/aws/resources/generated/native/kms/key/index.ts → providers/aws/generated/resources/kms/key.ts} +13 -41
  54. package/{src/providers/aws/resources/generated/native/lambda/function/index.ts → providers/aws/generated/resources/lambda/function.ts} +13 -63
  55. package/{src/providers/aws/resources/generated/native/lambda/permission/index.ts → providers/aws/generated/resources/lambda/permission.ts} +13 -55
  56. package/{src/providers/aws/resources/generated/native/s3/bucket/index.ts → providers/aws/generated/resources/s3/bucket.ts} +14 -104
  57. package/{src/providers/aws/resources/generated/native/sns/topic/index.ts → providers/aws/generated/resources/sns/topic.ts} +14 -29
  58. package/{src/providers/aws/resources/generated/native/sqs/queue/index.ts → providers/aws/generated/resources/sqs/queue.ts} +14 -38
  59. package/{src/providers/aws/resources/generated/native/stepfunctions/statemachine/index.ts → providers/aws/generated/resources/stepfunctions/statemachine.ts} +15 -58
  60. package/providers/aws/management/mappings/iam/group.ts +63 -0
  61. package/providers/aws/management/mappings/iam/iamIdentity.ts +41 -0
  62. package/providers/aws/management/mappings/iam/iamLifecycleSettings.ts +8 -0
  63. package/providers/aws/management/mappings/iam/inlinePolicies.ts +159 -0
  64. package/providers/aws/management/mappings/iam/instanceProfile.ts +77 -0
  65. package/providers/aws/management/mappings/iam/oidcProvider.ts +94 -0
  66. package/providers/aws/management/mappings/iam/role.ts +74 -0
  67. package/providers/aws/management/mappings/iam/samlProvider.ts +98 -0
  68. package/providers/aws/management/mappings/iam/serverCertificate.ts +72 -0
  69. package/providers/aws/management/mappings/iam/user.ts +61 -0
  70. package/providers/aws/management/mappings/iam/userToGroupAddition.ts +75 -0
  71. package/providers/aws/management/operations/iam/accessKey.ts +206 -0
  72. package/providers/aws/management/operations/iam/managedPolicy.ts +491 -0
  73. package/providers/aws/management/operations/iam/policy.ts +476 -0
  74. package/providers/aws/management/operations/iam/serviceLinkedRole.ts +172 -0
  75. package/providers/aws/management/operations/iam/virtualMfaDevice.ts +253 -0
  76. package/providers/aws/management/resourceAssociationConfiguration.ts +112 -0
  77. package/providers/aws/management/resourceAssociationRegistration.ts +349 -0
  78. package/providers/aws/management/resourceAssociations.ts +168 -0
  79. package/{src/providers → providers}/aws/management/resourceConfiguration.ts +24 -26
  80. package/providers/aws/management/resourceLifecycleRegistration.ts +540 -0
  81. package/providers/aws/management/resourceManagementModule.ts +31 -0
  82. package/providers/aws/management/resourceManagementRegistry.ts +62 -0
  83. package/providers/aws/management/resourceMapping.ts +84 -0
  84. package/providers/aws/management/resourceOperation.ts +134 -0
  85. package/providers/aws/management/resourceTagOperations.ts +108 -0
  86. package/providers/aws/management/resourceTiming.ts +4 -0
  87. package/providers/aws/runtime.ts +52 -0
  88. package/src/core/resource/resourceCommandPolicy.ts +20 -0
  89. package/src/core/resource/resourceLifecycle.ts +644 -0
  90. package/src/core/resource/resourceStabilization.ts +120 -0
  91. package/src/core/resource/resourceVersions.ts +102 -0
  92. package/src/core/stack/planner.ts +9 -0
  93. package/src/core/stack/resourceStackLifecycle.ts +36 -3
  94. package/src/core/state/resourceState.ts +6 -4
  95. package/src/core/state/stateStore.ts +57 -10
  96. package/src/providers/file/resourcePolicy.ts +13 -12
  97. package/src/providers/providerRuntimeLayer.ts +5 -2
  98. package/src/providers/resourceCommandPolicyLayer.ts +117 -37
  99. package/src/providers/stripe/management/resourcePolicy.ts +22 -11
  100. package/examples/http-echo/application.ts +0 -87
  101. package/src/providers/aws/client/awsClient.ts +0 -418
  102. package/src/providers/aws/client/awsClientConfig.ts +0 -133
  103. package/src/providers/aws/client/awsClientModel.ts +0 -119
  104. package/src/providers/aws/client/awsHttpOperation.ts +0 -153
  105. package/src/providers/aws/client/awsQueryOperation.ts +0 -149
  106. package/src/providers/aws/client/awsRequestSigner.ts +0 -115
  107. package/src/providers/aws/client/awsResponseDecoder.ts +0 -135
  108. package/src/providers/aws/client/awsRetryPolicy.ts +0 -62
  109. package/src/providers/aws/client/generated/apiGatewayV2.ts +0 -3025
  110. package/src/providers/aws/client/generated/cloudControl.ts +0 -5746
  111. package/src/providers/aws/client/generated/iam.ts +0 -10892
  112. package/src/providers/aws/client/generated/lambda.ts +0 -5403
  113. package/src/providers/aws/client/generated/sqs.ts +0 -3769
  114. package/src/providers/aws/client/generated/stepFunctions.ts +0 -1726
  115. package/src/providers/aws/client/openapi/cloudControl/CancelResourceRequest.json +0 -579
  116. package/src/providers/aws/client/openapi/cloudControl/CreateResource.json +0 -1019
  117. package/src/providers/aws/client/openapi/cloudControl/DeleteResource.json +0 -1018
  118. package/src/providers/aws/client/openapi/cloudControl/GetResource.json +0 -883
  119. package/src/providers/aws/client/openapi/cloudControl/GetResourceRequestStatus.json +0 -655
  120. package/src/providers/aws/client/openapi/cloudControl/ListResourceRequests.json +0 -566
  121. package/src/providers/aws/client/openapi/cloudControl/ListResources.json +0 -913
  122. package/src/providers/aws/client/openapi/cloudControl/UpdateResource.json +0 -1027
  123. package/src/providers/aws/cloudControl/client.ts +0 -69
  124. package/src/providers/aws/cloudControl/requestTracker.ts +0 -138
  125. package/src/providers/aws/cloudControl/resourceCommandPolicyLayer.ts +0 -63
  126. package/src/providers/aws/cloudControl/resourceLifecycle.ts +0 -479
  127. package/src/providers/aws/cloudControl/resources/generated/certificatemanager/certificate/index.ts +0 -179
  128. package/src/providers/aws/cloudControl/resources/generated/kms/key/index.ts +0 -362
  129. package/src/providers/aws/cloudControl/resources/generated/s3/bucket/index.ts +0 -2364
  130. package/src/providers/aws/cloudControl/resources/generated/sns/topic/index.ts +0 -326
  131. package/src/providers/aws/cloudControl/resources/generated/sqs/queue/index.ts +0 -307
  132. package/src/providers/aws/cloudControl/resources/generated/sqs/queueinlinepolicy/index.ts +0 -108
  133. package/src/providers/aws/cloudControl/runtime.ts +0 -127
  134. package/src/providers/aws/management/resourceMapping.ts +0 -343
  135. package/src/providers/aws/management/resourceOperation.ts +0 -57
  136. package/src/providers/aws/management/resourcePolicy.ts +0 -549
  137. package/src/providers/aws/management/resourceRegistration.ts +0 -294
  138. package/src/providers/aws/resources/apiGatewayV2/httpApi.ts +0 -327
  139. package/src/providers/aws/resources/generated/native/resourceCommands.ts +0 -152
  140. package/src/providers/aws/resources/iam/grant.ts +0 -150
  141. package/src/providers/aws/resources/iam/grantCommands.ts +0 -283
  142. package/src/providers/aws/resources/iam/policyDocument.ts +0 -30
  143. package/src/providers/aws/resources/iam/policyStatement.ts +0 -59
  144. package/src/providers/aws/resources/iam/role.ts +0 -426
  145. package/src/providers/aws/resources/iam/roleDeclaration.ts +0 -105
  146. package/src/providers/aws/resources/lambda/function.ts +0 -403
  147. package/src/providers/aws/resources/lambda/functionDeclaration.ts +0 -234
  148. package/src/providers/aws/resources/lambda/permission.ts +0 -363
  149. package/src/providers/aws/resources/stepFunctions/stateMachine.ts +0 -95
  150. package/src/providers/aws/runtime.ts +0 -70
@@ -0,0 +1,21 @@
1
+ # AWS provider
2
+
3
+ [generated/clients](generated/clients/) contains one npm package per AWS service. [generated/resources](generated/resources/) contains the TypeScript that applications use to declare AWS resources in a Nomoss stack.
4
+
5
+ [client-core](client-core/) contains the handwritten code that signs, sends, and decodes requests for the generated clients. [credentials](credentials/) contains the handwritten provider that resolves AWS profiles and obtains sessions through the generated STS, SSO, and SSO OIDC clients. Client core receives credentials through the `AwsCredentialProvider` service.
6
+
7
+ To call IAM directly with your environment or AWS CLI profile, import `makeIAMClient` from `@tradedal/aws-client-iam` and provide `awsClientLayerLive` from `@tradedal/aws-credentials`. The packages ship TypeScript for runners such as `tsx`. Nomoss calls the same IAM client when it applies supported IAM resources.
8
+
9
+ To call AWS as an IAM role, pass the role ARN and session name in the request to `awsAssumeRoleCredentialsLayer(stsRegion, request)` from `@tradedal/aws-credentials`. Provide HTTP transport and the source principal. For environment keys or a CLI sign-in, provide `awsDefaultCredentialsLayer`. For application-managed keys, decode the source with `AwsCredentials` and map a validation failure to `AwsClientConfigurationError`. Give that acquisition function to `awsCredentialProviderLayer`. These exports are available from `@tradedal/aws-client-core/config`.
10
+
11
+ Pass the role provider to `awsClientConfigLayerFromProvider` from `@tradedal/aws-client-core/config`, and provide that configuration and HTTP transport to `awsClientLayer`. The STS region selects where AWS issues the session. The application configures the region where it calls AWS with that session.
12
+
13
+ When a stack needs its AWS account, partition, or region, yield `AwsEnvironment` from `nomoss/providers/aws` and call `resolve()`. The service uses STS for the account and partition and the client configuration for the region. It returns branded values that callers can pass to `formatArn`. Pass an empty region for a global IAM ARN. Use the `AwsArn` schema to validate an ARN received as text and `AwsArnFromString` to read its components. Both schemas are available from `@tradedal/aws-client-core/model`.
14
+
15
+ ## Change IAM support
16
+
17
+ To add an IAM API operation, select it in the [IAM Smithy manifest](../../tools/awsServiceResources/sources/iam.json) and regenerate the [IAM client](generated/clients/iam/index.ts) using the [generation guide](../../tools/awsServiceResources/README.md#select-the-aws-operations).
18
+
19
+ To change what a stack accepts for an IAM group, start with the [CloudFormation Registry inputs](../../tools/awsServiceResources/sources/resources.json) and the [generated group declaration](generated/resources/iam/group.ts). To change what the stack sends to IAM, edit the [group lifecycle mapping](management/mappings/iam/group.ts). A [group membership mapping](management/mappings/iam/userToGroupAddition.ts) selects the native list, add, and remove operations. The shared lifecycle removes the declared memberships while leaving the group intact.
20
+
21
+ Keep provider requirements that cannot be expressed by a mapping in [IAM management operations](management/operations/iam/). For example, an [IAM managed policy](management/operations/iam/managedPolicy.ts) must publish a new default version before its document changes. It uses the same [association operations](management/resourceAssociations.ts) as group membership to add and remove selected attachments. Run `yarn generate:aws-management` after you add or rename a definition. The [IAM integration cases](../../tests/aws/native/iam/resourceLifecycleCases.ts) verify these behaviors against AWS.
@@ -0,0 +1,114 @@
1
+ import { AwsClientConfig } from "@tradedal/aws-client-core/config";
2
+ import {
3
+ AwsAccountId,
4
+ AwsArn,
5
+ AwsArnComponents,
6
+ AwsArnFromString,
7
+ AwsPartition,
8
+ AwsRegionName,
9
+ } from "@tradedal/aws-client-core/model";
10
+ import { makeSTSClient } from "@tradedal/aws-client-sts";
11
+ import { Context, Effect, Layer, Schema, Struct } from "effect";
12
+
13
+ const principal = Schema.Struct({
14
+ principalArn: AwsArn,
15
+ account: AwsAccountId,
16
+ principalId: Schema.NonEmptyString.pipe(Schema.brand("AwsPrincipalId")),
17
+ });
18
+
19
+ const callerIdentity = principal.pipe(
20
+ Schema.encodeKeys({
21
+ principalArn: "Arn",
22
+ account: "Account",
23
+ principalId: "UserId",
24
+ }),
25
+ );
26
+
27
+ const resolvedEnvironment = principal.mapFields((fields) => ({
28
+ ...fields,
29
+ partition: AwsPartition,
30
+ region: AwsRegionName,
31
+ }));
32
+ export type AwsResolvedEnvironment = typeof resolvedEnvironment.Type;
33
+
34
+ const arnResource = AwsArnComponents.mapFields((fields) => ({
35
+ service: fields.service,
36
+ resource: fields.resource,
37
+ region: Schema.optionalKey(fields.region),
38
+ }));
39
+
40
+ /**
41
+ * The AwsEnvironment service gives a stack the account and partition of its
42
+ * current AWS principal and the region selected by its client configuration.
43
+ * A global caller ARN can have an empty region even when the stack deploys
44
+ * into a region.
45
+ *
46
+ * @see ../../refs/aws-cdk/packages/aws-cdk-lib/core/lib/stack.ts (account, region, partition, and formatArn)
47
+ */
48
+ export class AwsEnvironment extends Context.Service<AwsEnvironment>()(
49
+ "nomoss/providers/aws/awsEnvironment",
50
+ {
51
+ make: Effect.gen(function* () {
52
+ const config = yield* AwsClientConfig;
53
+ const sts = yield* makeSTSClient;
54
+
55
+ /**
56
+ * The resolve service method asks STS which principal signed the request.
57
+ * Call it when a declaration needs concrete AWS account information. If
58
+ * the credentials fail or STS cannot identify the caller, the method fails
59
+ * before the stack can construct account-specific identifiers.
60
+ *
61
+ * @see ../../refs/aws-api-models/models/sts/service/2011-06-15/sts-2011-06-15.json (GetCallerIdentity)
62
+ */
63
+ const resolve = Effect.fn("AwsEnvironment.resolve")(function* () {
64
+ const { Region: region } = yield* config.resolveConfiguration();
65
+
66
+ const response = yield* sts.getCallerIdentity({});
67
+ const caller =
68
+ yield* Schema.decodeUnknownEffect(callerIdentity)(response);
69
+ const { partition } = yield* Schema.decodeEffect(AwsArnFromString)(
70
+ caller.principalArn,
71
+ );
72
+
73
+ const environment: AwsResolvedEnvironment = Struct.assign(caller, {
74
+ partition,
75
+ region,
76
+ });
77
+
78
+ return environment;
79
+ });
80
+
81
+ /**
82
+ * The formatArn service method uses the resolved environment's account
83
+ * and partition. Omit region to use the configured region or pass an
84
+ * empty string for a global IAM identifier.
85
+ *
86
+ * @see ../../refs/aws-cdk/packages/aws-cdk-lib/core/lib/stack.ts (formatArn)
87
+ */
88
+ const formatArn = Effect.fn("AwsEnvironment.formatArn")(function* (
89
+ environment: AwsResolvedEnvironment,
90
+ input: typeof arnResource.Encoded,
91
+ ) {
92
+ const components = yield* Schema.decodeEffect(arnResource)(input);
93
+
94
+ const arn = yield* Schema.encodeEffect(AwsArnFromString)({
95
+ partition: environment.partition,
96
+ account: environment.account,
97
+ ...components,
98
+ region: components.region ?? environment.region,
99
+ });
100
+ const formatted: AwsArn = yield* Schema.decodeEffect(AwsArn)(arn);
101
+
102
+ return formatted;
103
+ });
104
+
105
+ return { resolve, formatArn };
106
+ }),
107
+ },
108
+ ) {
109
+ /**
110
+ * The layer installs the environment service beside the existing AWS
111
+ * client. It performs no AWS request until a caller asks for the environment.
112
+ */
113
+ static layer = Layer.effect(AwsEnvironment, AwsEnvironment.make);
114
+ }
@@ -0,0 +1,136 @@
1
+ import { loadAwsManagementDefinition } from "../management/resourceManagementModule.js";
2
+
3
+ /**
4
+ * The awsManagementLoaders registry lets teardown find the AWS lifecycle
5
+ * from the resource type in saved state after you remove its declaration.
6
+ * Run `yarn generate:aws-management` after a change to a management export.
7
+ */
8
+ export const awsManagementLoaders = {
9
+ "iam:accesskey:create": loadAwsManagementDefinition(
10
+ "iam:accesskey:create",
11
+ () =>
12
+ // biome-ignore lint/plugin: Defer this import until a stack command requests the saved resource type.
13
+ import("../management/operations/iam/accessKey.js"),
14
+ (module) => module.AccessKeyManagement.make,
15
+ ),
16
+
17
+ "iam:group:create": loadAwsManagementDefinition(
18
+ "iam:group:create",
19
+ () =>
20
+ // biome-ignore lint/plugin: Defer this import until a stack command requests the saved resource type.
21
+ import("../management/mappings/iam/group.js"),
22
+ (module) => module.makeGroupManagement,
23
+ ),
24
+
25
+ "iam:grouppolicy:create": loadAwsManagementDefinition(
26
+ "iam:grouppolicy:create",
27
+ () =>
28
+ // biome-ignore lint/plugin: Defer this import until a stack command requests the saved resource type.
29
+ import("../management/mappings/iam/inlinePolicies.js"),
30
+ (module) => module.makeGroupPolicyManagement,
31
+ ),
32
+
33
+ "iam:instanceprofile:create": loadAwsManagementDefinition(
34
+ "iam:instanceprofile:create",
35
+ () =>
36
+ // biome-ignore lint/plugin: Defer this import until a stack command requests the saved resource type.
37
+ import("../management/mappings/iam/instanceProfile.js"),
38
+ (module) => module.makeInstanceProfileManagement,
39
+ ),
40
+
41
+ "iam:managedpolicy:create": loadAwsManagementDefinition(
42
+ "iam:managedpolicy:create",
43
+ () =>
44
+ // biome-ignore lint/plugin: Defer this import until a stack command requests the saved resource type.
45
+ import("../management/operations/iam/managedPolicy.js"),
46
+ (module) => module.ManagedPolicyManagement.make,
47
+ ),
48
+
49
+ "iam:oidcprovider:create": loadAwsManagementDefinition(
50
+ "iam:oidcprovider:create",
51
+ () =>
52
+ // biome-ignore lint/plugin: Defer this import until a stack command requests the saved resource type.
53
+ import("../management/mappings/iam/oidcProvider.js"),
54
+ (module) => module.makeOIDCProviderManagement,
55
+ ),
56
+
57
+ "iam:policy:create": loadAwsManagementDefinition(
58
+ "iam:policy:create",
59
+ () =>
60
+ // biome-ignore lint/plugin: Defer this import until a stack command requests the saved resource type.
61
+ import("../management/operations/iam/policy.js"),
62
+ (module) => module.PolicyManagement.make,
63
+ ),
64
+
65
+ "iam:role:create": loadAwsManagementDefinition(
66
+ "iam:role:create",
67
+ () =>
68
+ // biome-ignore lint/plugin: Defer this import until a stack command requests the saved resource type.
69
+ import("../management/mappings/iam/role.js"),
70
+ (module) => module.makeRoleManagement,
71
+ ),
72
+
73
+ "iam:rolepolicy:create": loadAwsManagementDefinition(
74
+ "iam:rolepolicy:create",
75
+ () =>
76
+ // biome-ignore lint/plugin: Defer this import until a stack command requests the saved resource type.
77
+ import("../management/mappings/iam/inlinePolicies.js"),
78
+ (module) => module.makeRolePolicyManagement,
79
+ ),
80
+
81
+ "iam:samlprovider:create": loadAwsManagementDefinition(
82
+ "iam:samlprovider:create",
83
+ () =>
84
+ // biome-ignore lint/plugin: Defer this import until a stack command requests the saved resource type.
85
+ import("../management/mappings/iam/samlProvider.js"),
86
+ (module) => module.makeSAMLProviderManagement,
87
+ ),
88
+
89
+ "iam:servercertificate:create": loadAwsManagementDefinition(
90
+ "iam:servercertificate:create",
91
+ () =>
92
+ // biome-ignore lint/plugin: Defer this import until a stack command requests the saved resource type.
93
+ import("../management/mappings/iam/serverCertificate.js"),
94
+ (module) => module.makeServerCertificateManagement,
95
+ ),
96
+
97
+ "iam:servicelinkedrole:create": loadAwsManagementDefinition(
98
+ "iam:servicelinkedrole:create",
99
+ () =>
100
+ // biome-ignore lint/plugin: Defer this import until a stack command requests the saved resource type.
101
+ import("../management/operations/iam/serviceLinkedRole.js"),
102
+ (module) => module.ServiceLinkedRoleManagement.make,
103
+ ),
104
+
105
+ "iam:user:create": loadAwsManagementDefinition(
106
+ "iam:user:create",
107
+ () =>
108
+ // biome-ignore lint/plugin: Defer this import until a stack command requests the saved resource type.
109
+ import("../management/mappings/iam/user.js"),
110
+ (module) => module.makeUserManagement,
111
+ ),
112
+
113
+ "iam:userpolicy:create": loadAwsManagementDefinition(
114
+ "iam:userpolicy:create",
115
+ () =>
116
+ // biome-ignore lint/plugin: Defer this import until a stack command requests the saved resource type.
117
+ import("../management/mappings/iam/inlinePolicies.js"),
118
+ (module) => module.makeUserPolicyManagement,
119
+ ),
120
+
121
+ "iam:usertogroupaddition:create": loadAwsManagementDefinition(
122
+ "iam:usertogroupaddition:create",
123
+ () =>
124
+ // biome-ignore lint/plugin: Defer this import until a stack command requests the saved resource type.
125
+ import("../management/mappings/iam/userToGroupAddition.js"),
126
+ (module) => module.makeUserToGroupAdditionManagement,
127
+ ),
128
+
129
+ "iam:virtualmfadevice:create": loadAwsManagementDefinition(
130
+ "iam:virtualmfadevice:create",
131
+ () =>
132
+ // biome-ignore lint/plugin: Defer this import until a stack command requests the saved resource type.
133
+ import("../management/operations/iam/virtualMfaDevice.js"),
134
+ (module) => module.VirtualMfaDeviceManagement.make,
135
+ ),
136
+ };
@@ -9,7 +9,7 @@ import {
9
9
  ResourceReferenceSchema,
10
10
  ResourceSchemaAnnotationSchema,
11
11
  } from "nomoss/core";
12
- import { ResourceOutputBinding } from "../../../../../../../core/resource/resourceOutputBinding.js";
12
+ import { ResourceOutputBinding } from "../../../../../src/core/resource/resourceOutputBinding.js";
13
13
 
14
14
  interface BodyS3Location {
15
15
  readonly Etag?: string;
@@ -138,6 +138,7 @@ export const AWSApiResourceSchema = ResourceSchemaAnnotationSchema.make({
138
138
  },
139
139
  primaryIdentifier: ["/properties/ApiId"],
140
140
  });
141
+
141
142
  export const AWSApiPropsSchema = annotateResourceSchema(
142
143
  Schema.Struct({
143
144
  RouteSelectionExpression: Schema.optionalKey(
@@ -407,7 +408,14 @@ export const AWSApiRequestSchema = Schema.Struct({
407
408
  }),
408
409
  ),
409
410
  });
411
+
412
+ /**
413
+ * The AWSApiRelationshipIssues array lists inputs that can use several outputs
414
+ * from one source type. Each input retains its provider value until a reviewed
415
+ * mapping chooses an output.
416
+ */
410
417
  export const AWSApiRelationshipIssues = [];
418
+
411
419
  export const AWSApiResourceTypeSchema = Schema.Struct({
412
420
  provider: Schema.Literal("aws"),
413
421
  service: Schema.Literal("apigatewayv2"),
@@ -487,7 +495,10 @@ export function createAWSApiDeclaration<Props>(
487
495
  return resource;
488
496
  }
489
497
 
490
- /** The AWSApi resource factory validates properties and registers the resource in the shared graph. Provider values become available after apply saves the resource. */
498
+ /**
499
+ * The AWSApi resource factory registers a validated declaration in the
500
+ * stack graph. Its outputs become available after apply saves the resource.
501
+ */
491
502
  export const AWSApi = Effect.fn("AWSApi")(function* (input: {
492
503
  logicalId: string;
493
504
  props: AWSApiProps;
@@ -515,51 +526,3 @@ export const AWSApi = Effect.fn("AWSApi")(function* (input: {
515
526
 
516
527
  return resource;
517
528
  });
518
- export const AWSApiOutputCatalog = [
519
- {
520
- source: {
521
- provider: "AWS",
522
- service: "CloudFormation",
523
- name: "refs/aws-cdk-service-spec/sources/CloudFormationSchema/us-east-1/aws-apigatewayv2-api.json",
524
- format: "CloudFormation",
525
- },
526
- typeName: "AWS::ApiGatewayV2::Api",
527
- resource: "api",
528
- primaryIdentifier: ["/properties/ApiId"],
529
- createOnlyProperties: ["/properties/ProtocolType"],
530
- writeOnlyProperties: [
531
- "/properties/Body",
532
- "/properties/BasePath",
533
- "/properties/BodyS3Location",
534
- "/properties/BodyS3Location/Etag",
535
- "/properties/BodyS3Location/Bucket",
536
- "/properties/BodyS3Location/Version",
537
- "/properties/BodyS3Location/Key",
538
- "/properties/CredentialsArn",
539
- "/properties/FailOnWarnings",
540
- "/properties/RouteKey",
541
- "/properties/Target",
542
- "/properties/DisableSchemaValidation",
543
- ],
544
- outputs: {
545
- ApiId: {
546
- schema: {
547
- type: "string",
548
- description: "",
549
- },
550
- schemaPath: "/properties/ApiId",
551
- valuePath: "/ApiId",
552
- required: false,
553
- },
554
- ApiEndpoint: {
555
- schema: {
556
- type: "string",
557
- description: "",
558
- },
559
- schemaPath: "/properties/ApiEndpoint",
560
- valuePath: "/ApiEndpoint",
561
- required: false,
562
- },
563
- },
564
- },
565
- ];
@@ -9,7 +9,7 @@ import {
9
9
  ResourceReferenceSchema,
10
10
  ResourceSchemaAnnotationSchema,
11
11
  } from "nomoss/core";
12
- import { ResourceOutputBinding } from "../../../../../../../core/resource/resourceOutputBinding.js";
12
+ import { ResourceOutputBinding } from "../../../../../src/core/resource/resourceOutputBinding.js";
13
13
 
14
14
  interface ResponseParameter {
15
15
  readonly Destination?: string;
@@ -107,6 +107,7 @@ export const AWSIntegrationResourceSchema = ResourceSchemaAnnotationSchema.make(
107
107
  primaryIdentifier: ["/properties/ApiId", "/properties/IntegrationId"],
108
108
  },
109
109
  );
110
+
110
111
  export const AWSIntegrationPropsSchema = annotateResourceSchema(
111
112
  Schema.Struct({
112
113
  ApiId: Schema.Union([
@@ -436,7 +437,14 @@ export const AWSIntegrationRequestSchema = Schema.Struct({
436
437
  ),
437
438
  TlsConfig: Schema.optionalKey(TlsConfig),
438
439
  });
440
+
441
+ /**
442
+ * The AWSIntegrationRelationshipIssues array lists inputs that can use several outputs
443
+ * from one source type. Each input retains its provider value until a reviewed
444
+ * mapping chooses an output.
445
+ */
439
446
  export const AWSIntegrationRelationshipIssues = [];
447
+
440
448
  export const AWSIntegrationResourceTypeSchema = Schema.Struct({
441
449
  provider: Schema.Literal("aws"),
442
450
  service: Schema.Literal("apigatewayv2"),
@@ -516,7 +524,10 @@ export function createAWSIntegrationDeclaration<Props>(
516
524
  return resource;
517
525
  }
518
526
 
519
- /** The AWSIntegration resource factory validates properties and registers the resource in the shared graph. Provider values become available after apply saves the resource. */
527
+ /**
528
+ * The AWSIntegration resource factory registers a validated declaration in the
529
+ * stack graph. Its outputs become available after apply saves the resource.
530
+ */
520
531
  export const AWSIntegration = Effect.fn("AWSIntegration")(function* (input: {
521
532
  logicalId: string;
522
533
  props: AWSIntegrationProps;
@@ -546,38 +557,3 @@ export const AWSIntegration = Effect.fn("AWSIntegration")(function* (input: {
546
557
 
547
558
  return resource;
548
559
  });
549
- export const AWSIntegrationOutputCatalog = [
550
- {
551
- source: {
552
- provider: "AWS",
553
- service: "CloudFormation",
554
- name: "refs/aws-cdk-service-spec/sources/CloudFormationSchema/us-east-1/aws-apigatewayv2-integration.json",
555
- format: "CloudFormation",
556
- },
557
- typeName: "AWS::ApiGatewayV2::Integration",
558
- resource: "integration",
559
- primaryIdentifier: ["/properties/ApiId", "/properties/IntegrationId"],
560
- createOnlyProperties: ["/properties/ApiId"],
561
- writeOnlyProperties: [],
562
- outputs: {
563
- IntegrationId: {
564
- schema: {
565
- description: "The integration ID.",
566
- type: "string",
567
- },
568
- schemaPath: "/properties/IntegrationId",
569
- valuePath: "/IntegrationId",
570
- required: false,
571
- },
572
- ApiId: {
573
- schema: {
574
- description: "The API identifier.",
575
- type: "string",
576
- },
577
- schemaPath: "/properties/ApiId",
578
- valuePath: "/ApiId",
579
- required: true,
580
- },
581
- },
582
- },
583
- ];
@@ -9,7 +9,8 @@ import {
9
9
  ResourceReferenceSchema,
10
10
  ResourceSchemaAnnotationSchema,
11
11
  } from "nomoss/core";
12
- import { ResourceOutputBinding } from "../../../../../../../core/resource/resourceOutputBinding.js";
12
+ import { ResourceOutputBinding } from "../../../../../src/core/resource/resourceOutputBinding.js";
13
+ import { relationshipValueCodec } from "../../../management/resourceOperation.js";
13
14
 
14
15
  export interface AWSRouteProps {
15
16
  readonly RouteResponseSelectionExpression?: string;
@@ -60,6 +61,7 @@ export const AWSRouteResourceSchema = ResourceSchemaAnnotationSchema.make({
60
61
  },
61
62
  primaryIdentifier: ["/properties/ApiId", "/properties/RouteId"],
62
63
  });
64
+
63
65
  export const AWSRoutePropsSchema = annotateResourceSchema(
64
66
  Schema.Struct({
65
67
  RouteResponseSelectionExpression: Schema.optionalKey(
@@ -289,7 +291,23 @@ export const AWSRouteRequestSchema = Schema.Struct({
289
291
  }),
290
292
  ),
291
293
  });
294
+
295
+ /**
296
+ * The AWSRouteRelationshipValueCodecs object lets an operation accept bare
297
+ * IDs and AWS-prefixed IDs. Reads return the bare ID for comparison with the
298
+ * declared relationship.
299
+ */
300
+ export const AWSRouteRelationshipValueCodecs = {
301
+ Target: relationshipValueCodec("integrations/"),
302
+ };
303
+
304
+ /**
305
+ * The AWSRouteRelationshipIssues array lists inputs that can use several outputs
306
+ * from one source type. Each input retains its provider value until a reviewed
307
+ * mapping chooses an output.
308
+ */
292
309
  export const AWSRouteRelationshipIssues = [];
310
+
293
311
  export const AWSRouteResourceTypeSchema = Schema.Struct({
294
312
  provider: Schema.Literal("aws"),
295
313
  service: Schema.Literal("apigatewayv2"),
@@ -370,7 +388,10 @@ export function createAWSRouteDeclaration<Props>(
370
388
  return resource;
371
389
  }
372
390
 
373
- /** The AWSRoute resource factory validates properties and registers the resource in the shared graph. Provider values become available after apply saves the resource. */
391
+ /**
392
+ * The AWSRoute resource factory registers a validated declaration in the
393
+ * stack graph. Its outputs become available after apply saves the resource.
394
+ */
374
395
  export const AWSRoute = Effect.fn("AWSRoute")(function* (input: {
375
396
  logicalId: string;
376
397
  props: AWSRouteProps;
@@ -398,41 +419,3 @@ export const AWSRoute = Effect.fn("AWSRoute")(function* (input: {
398
419
 
399
420
  return resource;
400
421
  });
401
- export const AWSRouteOutputCatalog = [
402
- {
403
- source: {
404
- provider: "AWS",
405
- service: "CloudFormation",
406
- name: "refs/aws-cdk-service-spec/sources/CloudFormationSchema/us-east-1/aws-apigatewayv2-route.json",
407
- format: "CloudFormation",
408
- },
409
- typeName: "AWS::ApiGatewayV2::Route",
410
- resource: "route",
411
- primaryIdentifier: ["/properties/ApiId", "/properties/RouteId"],
412
- createOnlyProperties: ["/properties/ApiId"],
413
- writeOnlyProperties: [
414
- "/properties/AuthorizerId",
415
- "/properties/RequestParameters",
416
- ],
417
- outputs: {
418
- RouteId: {
419
- schema: {
420
- type: "string",
421
- description: "",
422
- },
423
- schemaPath: "/properties/RouteId",
424
- valuePath: "/RouteId",
425
- required: false,
426
- },
427
- ApiId: {
428
- schema: {
429
- type: "string",
430
- description: "The API identifier.",
431
- },
432
- schemaPath: "/properties/ApiId",
433
- valuePath: "/ApiId",
434
- required: true,
435
- },
436
- },
437
- },
438
- ];
@@ -9,7 +9,7 @@ import {
9
9
  ResourceReferenceSchema,
10
10
  ResourceSchemaAnnotationSchema,
11
11
  } from "nomoss/core";
12
- import { ResourceOutputBinding } from "../../../../../../../core/resource/resourceOutputBinding.js";
12
+ import { ResourceOutputBinding } from "../../../../../src/core/resource/resourceOutputBinding.js";
13
13
 
14
14
  interface AccessLogSettings {
15
15
  readonly Format?: string;
@@ -75,6 +75,7 @@ export const AWSStageResourceSchema = ResourceSchemaAnnotationSchema.make({
75
75
  },
76
76
  primaryIdentifier: ["/properties/ApiId", "/properties/StageName"],
77
77
  });
78
+
78
79
  export const AWSStagePropsSchema = annotateResourceSchema(
79
80
  Schema.Struct({
80
81
  ClientCertificateId: Schema.optionalKey(
@@ -244,7 +245,14 @@ export const AWSStageRequestSchema = Schema.Struct({
244
245
  }),
245
246
  ),
246
247
  });
248
+
249
+ /**
250
+ * The AWSStageRelationshipIssues array lists inputs that can use several outputs
251
+ * from one source type. Each input retains its provider value until a reviewed
252
+ * mapping chooses an output.
253
+ */
247
254
  export const AWSStageRelationshipIssues = [];
255
+
248
256
  export const AWSStageResourceTypeSchema = Schema.Struct({
249
257
  provider: Schema.Literal("aws"),
250
258
  service: Schema.Literal("apigatewayv2"),
@@ -325,7 +333,10 @@ export function createAWSStageDeclaration<Props>(
325
333
  return resource;
326
334
  }
327
335
 
328
- /** The AWSStage resource factory validates properties and registers the resource in the shared graph. Provider values become available after apply saves the resource. */
336
+ /**
337
+ * The AWSStage resource factory registers a validated declaration in the
338
+ * stack graph. Its outputs become available after apply saves the resource.
339
+ */
329
340
  export const AWSStage = Effect.fn("AWSStage")(function* (input: {
330
341
  logicalId: string;
331
342
  props: AWSStageProps;
@@ -353,39 +364,3 @@ export const AWSStage = Effect.fn("AWSStage")(function* (input: {
353
364
 
354
365
  return resource;
355
366
  });
356
- export const AWSStageOutputCatalog = [
357
- {
358
- source: {
359
- provider: "AWS",
360
- service: "CloudFormation",
361
- name: "refs/aws-cdk-service-spec/sources/CloudFormationSchema/us-east-1/aws-apigatewayv2-stage.json",
362
- format: "CloudFormation",
363
- },
364
- typeName: "AWS::ApiGatewayV2::Stage",
365
- resource: "stage",
366
- primaryIdentifier: ["/properties/ApiId", "/properties/StageName"],
367
- createOnlyProperties: ["/properties/StageName", "/properties/ApiId"],
368
- writeOnlyProperties: [],
369
- outputs: {
370
- ApiId: {
371
- schema: {
372
- description: "The API identifier.",
373
- type: "string",
374
- },
375
- schemaPath: "/properties/ApiId",
376
- valuePath: "/ApiId",
377
- required: true,
378
- },
379
- StageName: {
380
- schema: {
381
- description:
382
- "The stage name. Stage names can contain only alphanumeric characters, hyphens, and underscores, or be $default. Maximum length is 128 characters.",
383
- type: "string",
384
- },
385
- schemaPath: "/properties/StageName",
386
- valuePath: "/StageName",
387
- required: true,
388
- },
389
- },
390
- },
391
- ];