nomoss 0.0.3 → 0.0.5

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 +34 -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
@@ -9,10 +9,10 @@ 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
  export interface AWSRolePolicyProps {
15
- readonly PolicyDocument?: {
15
+ readonly PolicyDocument: {
16
16
  readonly [x: string]: Schema.Json;
17
17
  };
18
18
  readonly PolicyName: string;
@@ -37,17 +37,16 @@ export const AWSRolePolicyResourceSchema = ResourceSchemaAnnotationSchema.make({
37
37
  },
38
38
  primaryIdentifier: ["/properties/PolicyName", "/properties/RoleName"],
39
39
  });
40
+
40
41
  export const AWSRolePolicyPropsSchema = annotateResourceSchema(
41
42
  Schema.Struct({
42
- PolicyDocument: Schema.optionalKey(
43
- Schema.Record(
44
- Schema.String,
45
- Schema.Json.annotate({ expected: "JSON value" }),
46
- ).annotate({
47
- description:
48
- "The policy document.\n You must provide policies in JSON format in IAM. However, for CFN templates formatted in YAML, you can provide the policy in JSON or YAML format. CFN always converts a YAML policy to JSON format before submitting it to IAM.\n The [regex pattern](https://docs.aws.amazon.com/http://wikipedia.org/wiki/regex) used to validate this parameter is a string of characters consisting of the following:\n + Any printable ASCII character ranging from the space character (``\\u0020``) through the end of the ASCII character range\n + The printable characters in the Basic Latin and Latin-1 Supplement character set (through ``\\u00FF``)\n + The special characters tab (``\\u0009``), line feed (``\\u000A``), and carriage return (``\\u000D``)",
49
- }),
50
- ),
43
+ PolicyDocument: Schema.Record(
44
+ Schema.String,
45
+ Schema.Json.annotate({ expected: "JSON value" }),
46
+ ).annotate({
47
+ description:
48
+ "The policy document.\n You must provide policies in JSON format in IAM. However, for CFN templates formatted in YAML, you can provide the policy in JSON or YAML format. CFN always converts a YAML policy to JSON format before submitting it to IAM.\n The [regex pattern](https://docs.aws.amazon.com/http://wikipedia.org/wiki/regex) used to validate this parameter is a string of characters consisting of the following:\n + Any printable ASCII character ranging from the space character (``\\u0020``) through the end of the ASCII character range\n + The printable characters in the Basic Latin and Latin-1 Supplement character set (through ``\\u00FF``)\n + The special characters tab (``\\u0009``), line feed (``\\u000A``), and carriage return (``\\u000D``)",
49
+ }),
51
50
  PolicyName: Schema.String.annotate({
52
51
  description:
53
52
  "The name of the policy document.\n This parameter allows (through its [regex pattern](https://docs.aws.amazon.com/http://wikipedia.org/wiki/regex)) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-",
@@ -97,7 +96,7 @@ export const AWSRolePolicyOutputsSchema = Schema.Struct({
97
96
  });
98
97
 
99
98
  export interface AWSRolePolicyRequest {
100
- readonly PolicyDocument?: {
99
+ readonly PolicyDocument: {
101
100
  readonly [x: string]: Schema.Json;
102
101
  };
103
102
  readonly PolicyName: string;
@@ -105,15 +104,13 @@ export interface AWSRolePolicyRequest {
105
104
  }
106
105
 
107
106
  export const AWSRolePolicyRequestSchema = Schema.Struct({
108
- PolicyDocument: Schema.optionalKey(
109
- Schema.Record(
110
- Schema.String,
111
- Schema.Json.annotate({ expected: "JSON value" }),
112
- ).annotate({
113
- description:
114
- "The policy document.\n You must provide policies in JSON format in IAM. However, for CFN templates formatted in YAML, you can provide the policy in JSON or YAML format. CFN always converts a YAML policy to JSON format before submitting it to IAM.\n The [regex pattern](https://docs.aws.amazon.com/http://wikipedia.org/wiki/regex) used to validate this parameter is a string of characters consisting of the following:\n + Any printable ASCII character ranging from the space character (``\\u0020``) through the end of the ASCII character range\n + The printable characters in the Basic Latin and Latin-1 Supplement character set (through ``\\u00FF``)\n + The special characters tab (``\\u0009``), line feed (``\\u000A``), and carriage return (``\\u000D``)",
115
- }),
116
- ),
107
+ PolicyDocument: Schema.Record(
108
+ Schema.String,
109
+ Schema.Json.annotate({ expected: "JSON value" }),
110
+ ).annotate({
111
+ description:
112
+ "The policy document.\n You must provide policies in JSON format in IAM. However, for CFN templates formatted in YAML, you can provide the policy in JSON or YAML format. CFN always converts a YAML policy to JSON format before submitting it to IAM.\n The [regex pattern](https://docs.aws.amazon.com/http://wikipedia.org/wiki/regex) used to validate this parameter is a string of characters consisting of the following:\n + Any printable ASCII character ranging from the space character (``\\u0020``) through the end of the ASCII character range\n + The printable characters in the Basic Latin and Latin-1 Supplement character set (through ``\\u00FF``)\n + The special characters tab (``\\u0009``), line feed (``\\u000A``), and carriage return (``\\u000D``)",
113
+ }),
117
114
  PolicyName: Schema.String.annotate({
118
115
  description:
119
116
  "The name of the policy document.\n This parameter allows (through its [regex pattern](https://docs.aws.amazon.com/http://wikipedia.org/wiki/regex)) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-",
@@ -123,7 +120,14 @@ export const AWSRolePolicyRequestSchema = Schema.Struct({
123
120
  "The name of the role to associate the policy with.\n This parameter allows (through its [regex pattern](https://docs.aws.amazon.com/http://wikipedia.org/wiki/regex)) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-",
124
121
  }),
125
122
  });
123
+
124
+ /**
125
+ * The AWSRolePolicyRelationshipIssues array lists inputs that can use several outputs
126
+ * from one source type. Each input retains its provider value until a reviewed
127
+ * mapping chooses an output.
128
+ */
126
129
  export const AWSRolePolicyRelationshipIssues = [];
130
+
127
131
  export const AWSRolePolicyResourceTypeSchema = Schema.Struct({
128
132
  provider: Schema.Literal("aws"),
129
133
  service: Schema.Literal("iam"),
@@ -203,7 +207,10 @@ export function createAWSRolePolicyDeclaration<Props>(
203
207
  return resource;
204
208
  }
205
209
 
206
- /** The AWSRolePolicy resource factory validates properties and registers the resource in the shared graph. Provider values become available after apply saves the resource. */
210
+ /**
211
+ * The AWSRolePolicy resource factory registers a validated declaration in the
212
+ * stack graph. Its outputs become available after apply saves the resource.
213
+ */
207
214
  export const AWSRolePolicy = Effect.fn("AWSRolePolicy")(function* (input: {
208
215
  logicalId: string;
209
216
  props: AWSRolePolicyProps;
@@ -233,40 +240,3 @@ export const AWSRolePolicy = Effect.fn("AWSRolePolicy")(function* (input: {
233
240
 
234
241
  return resource;
235
242
  });
236
- export const AWSRolePolicyOutputCatalog = [
237
- {
238
- source: {
239
- provider: "AWS",
240
- service: "CloudFormation",
241
- name: "refs/aws-cdk-service-spec/sources/CloudFormationSchema/us-east-1/aws-iam-rolepolicy.json",
242
- format: "CloudFormation",
243
- },
244
- typeName: "AWS::IAM::RolePolicy",
245
- resource: "rolepolicy",
246
- primaryIdentifier: ["/properties/PolicyName", "/properties/RoleName"],
247
- createOnlyProperties: ["/properties/PolicyName", "/properties/RoleName"],
248
- writeOnlyProperties: [],
249
- outputs: {
250
- PolicyName: {
251
- schema: {
252
- description:
253
- "The name of the policy document.\n This parameter allows (through its [regex pattern](https://docs.aws.amazon.com/http://wikipedia.org/wiki/regex)) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-",
254
- type: "string",
255
- },
256
- schemaPath: "/properties/PolicyName",
257
- valuePath: "/PolicyName",
258
- required: true,
259
- },
260
- RoleName: {
261
- schema: {
262
- description:
263
- "The name of the role to associate the policy with.\n This parameter allows (through its [regex pattern](https://docs.aws.amazon.com/http://wikipedia.org/wiki/regex)) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-",
264
- type: "string",
265
- },
266
- schemaPath: "/properties/RoleName",
267
- valuePath: "/RoleName",
268
- required: true,
269
- },
270
- },
271
- },
272
- ];
@@ -0,0 +1,463 @@
1
+ // Generated from the CloudFormation Registry resource schema. Do not edit.
2
+ // biome-ignore-all lint/complexity/useRegexLiterals: Preserve Effect's generated regular expressions.
3
+ import { Effect, Schema } from "effect";
4
+ import {
5
+ annotateResourceSchema,
6
+ ResourceEntity,
7
+ ResourceGraphBuilder,
8
+ type ResourceKey,
9
+ ResourceSchemaAnnotationSchema,
10
+ } from "nomoss/core";
11
+ import { ResourceOutputBinding } from "../../../../../src/core/resource/resourceOutputBinding.js";
12
+
13
+ interface Tag {
14
+ readonly Value: string;
15
+ readonly Key: string;
16
+ }
17
+
18
+ const Tag = Schema.Struct({
19
+ Value: Schema.String.annotate({
20
+ description:
21
+ "The value for the tag. You can specify a value that is 0 to 256 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.",
22
+ })
23
+ .check(
24
+ Schema.isMinLength(1).annotate({
25
+ expected: "a value with a length of at least 1",
26
+ }),
27
+ )
28
+ .check(
29
+ Schema.isMaxCodePoints(256).annotate({
30
+ expected: "a string with at most 256 code points",
31
+ }),
32
+ ),
33
+ Key: Schema.String.annotate({
34
+ description:
35
+ "The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.",
36
+ })
37
+ .check(
38
+ Schema.isMinLength(1).annotate({
39
+ expected: "a value with a length of at least 1",
40
+ }),
41
+ )
42
+ .check(
43
+ Schema.isMaxCodePoints(128).annotate({
44
+ expected: "a string with at most 128 code points",
45
+ }),
46
+ ),
47
+ }).annotate({
48
+ description: "A key-value pair to associate with a resource.",
49
+ identifier: "Tag",
50
+ });
51
+
52
+ interface SAMLPrivateKey {
53
+ readonly KeyId: string;
54
+ readonly Timestamp: string;
55
+ }
56
+
57
+ const SAMLPrivateKey = Schema.Struct({
58
+ KeyId: Schema.String.annotate({
59
+ description: "The unique identifier for the SAML private key.",
60
+ })
61
+ .check(
62
+ Schema.isMinCodePoints(22).annotate({
63
+ expected: "a string with at least 22 code points",
64
+ }),
65
+ )
66
+ .check(
67
+ Schema.isMaxCodePoints(64).annotate({
68
+ expected: "a string with at most 64 code points",
69
+ }),
70
+ )
71
+ .check(
72
+ Schema.isPattern(new globalThis.RegExp("[A-Z0-9]+", "u")).annotate({
73
+ expected: "a string matching the RegExp [A-Z0-9]+",
74
+ }),
75
+ ),
76
+ Timestamp: Schema.String.annotate({
77
+ description:
78
+ 'The date and time, in <a href=\\"http://www.iso.org/iso/iso8601\\">ISO 8601 date-time </a> format, when the private key was uploaded.',
79
+ format: "date-time",
80
+ }),
81
+ }).annotate({
82
+ description: "The private key metadata for the SAML provider",
83
+ identifier: "SAMLPrivateKey",
84
+ });
85
+
86
+ export interface AWSSAMLProviderProps {
87
+ readonly Name?: string;
88
+ readonly SamlMetadataDocument?: string;
89
+ readonly Tags?: ReadonlyArray<Tag>;
90
+ readonly AssertionEncryptionMode?: "Allowed" | "Required";
91
+ readonly AddPrivateKey?: string;
92
+ readonly RemovePrivateKey?: string;
93
+ readonly PrivateKeyList?: ReadonlyArray<SAMLPrivateKey>;
94
+ }
95
+
96
+ export const AWSSAMLProviderResourceSchema =
97
+ ResourceSchemaAnnotationSchema.make({
98
+ provider: "aws",
99
+ service: "iam",
100
+ resource: "samlprovider",
101
+ operation: "create",
102
+ stateSecretOutputKeys: [],
103
+ replacement: {
104
+ order: "createBeforeDestroy",
105
+ properties: [["Name"], ["AddPrivateKey"], ["RemovePrivateKey"]],
106
+ },
107
+ primaryIdentifier: ["/properties/Arn"],
108
+ });
109
+
110
+ export const AWSSAMLProviderPropsSchema = annotateResourceSchema(
111
+ Schema.Struct({
112
+ Name: Schema.optionalKey(
113
+ Schema.String.check(
114
+ Schema.isMinLength(1).annotate({
115
+ expected: "a value with a length of at least 1",
116
+ }),
117
+ )
118
+ .check(
119
+ Schema.isMaxCodePoints(128).annotate({
120
+ expected: "a string with at most 128 code points",
121
+ }),
122
+ )
123
+ .check(
124
+ Schema.isPattern(new globalThis.RegExp("[\\w._-]+", "u")).annotate({
125
+ expected: "a string matching the RegExp [\\w._-]+",
126
+ }),
127
+ ),
128
+ ),
129
+ SamlMetadataDocument: Schema.optionalKey(
130
+ Schema.String.check(
131
+ Schema.isMinCodePoints(1000).annotate({
132
+ expected: "a string with at least 1000 code points",
133
+ }),
134
+ ).check(
135
+ Schema.isMaxCodePoints(10000000).annotate({
136
+ expected: "a string with at most 10000000 code points",
137
+ }),
138
+ ),
139
+ ),
140
+ Tags: Schema.optionalKey(Schema.Array(Tag)),
141
+ AssertionEncryptionMode: Schema.optionalKey(
142
+ Schema.Literals(["Allowed", "Required"]).annotate({
143
+ description: "The encryption setting for the SAML provider",
144
+ }),
145
+ ),
146
+ AddPrivateKey: Schema.optionalKey(
147
+ Schema.String.annotate({
148
+ description: "The private key from your external identity provider",
149
+ })
150
+ .check(
151
+ Schema.isMinLength(1).annotate({
152
+ expected: "a value with a length of at least 1",
153
+ }),
154
+ )
155
+ .check(
156
+ Schema.isMaxCodePoints(16384).annotate({
157
+ expected: "a string with at most 16384 code points",
158
+ }),
159
+ )
160
+ .check(
161
+ Schema.isPattern(
162
+ new globalThis.RegExp(
163
+ "[\\u0009\\u000A\\u000D\\u0020-\\u00FF]+",
164
+ "u",
165
+ ),
166
+ ).annotate({
167
+ expected:
168
+ "a string matching the RegExp [\\u0009\\u000A\\u000D\\u0020-\\u00FF]+",
169
+ }),
170
+ ),
171
+ ),
172
+ RemovePrivateKey: Schema.optionalKey(
173
+ Schema.String.annotate({
174
+ description: "The Key ID of the private key to remove",
175
+ })
176
+ .check(
177
+ Schema.isMinCodePoints(22).annotate({
178
+ expected: "a string with at least 22 code points",
179
+ }),
180
+ )
181
+ .check(
182
+ Schema.isMaxCodePoints(64).annotate({
183
+ expected: "a string with at most 64 code points",
184
+ }),
185
+ )
186
+ .check(
187
+ Schema.isPattern(new globalThis.RegExp("[A-Z0-9]+", "u")).annotate({
188
+ expected: "a string matching the RegExp [A-Z0-9]+",
189
+ }),
190
+ ),
191
+ ),
192
+ PrivateKeyList: Schema.optionalKey(
193
+ Schema.Array(SAMLPrivateKey).check(
194
+ Schema.isMaxLength(2).annotate({
195
+ expected: "a value with a length of at most 2",
196
+ }),
197
+ ),
198
+ ),
199
+ }),
200
+ AWSSAMLProviderResourceSchema,
201
+ );
202
+
203
+ export interface AWSSAMLProviderOutputs {
204
+ readonly Arn?: string;
205
+ readonly SamlProviderUUID?: string;
206
+ }
207
+
208
+ export const AWSSAMLProviderOutputsSchema = Schema.Struct({
209
+ Arn: Schema.optionalKey(
210
+ Schema.String.annotate({
211
+ description: "Amazon Resource Name (ARN) of the SAML provider",
212
+ })
213
+ .check(
214
+ Schema.isMinLength(1).annotate({
215
+ expected: "a value with a length of at least 1",
216
+ }),
217
+ )
218
+ .check(
219
+ Schema.isMaxCodePoints(1600).annotate({
220
+ expected: "a string with at most 1600 code points",
221
+ }),
222
+ ),
223
+ ),
224
+ SamlProviderUUID: Schema.optionalKey(
225
+ Schema.String.annotate({
226
+ description: "The unique identifier assigned to the SAML provider",
227
+ })
228
+ .check(
229
+ Schema.isMinCodePoints(22).annotate({
230
+ expected: "a string with at least 22 code points",
231
+ }),
232
+ )
233
+ .check(
234
+ Schema.isMaxCodePoints(64).annotate({
235
+ expected: "a string with at most 64 code points",
236
+ }),
237
+ )
238
+ .check(
239
+ Schema.isPattern(new globalThis.RegExp("[A-Z0-9]+", "u")).annotate({
240
+ expected: "a string matching the RegExp [A-Z0-9]+",
241
+ }),
242
+ ),
243
+ ),
244
+ });
245
+
246
+ export interface AWSSAMLProviderRequest {
247
+ readonly Name?: string;
248
+ readonly SamlMetadataDocument?: string;
249
+ readonly Tags?: ReadonlyArray<Tag>;
250
+ readonly AssertionEncryptionMode?: "Allowed" | "Required";
251
+ readonly AddPrivateKey?: string;
252
+ readonly RemovePrivateKey?: string;
253
+ readonly PrivateKeyList?: ReadonlyArray<SAMLPrivateKey>;
254
+ }
255
+
256
+ export const AWSSAMLProviderRequestSchema = Schema.Struct({
257
+ Name: Schema.optionalKey(
258
+ Schema.String.check(
259
+ Schema.isMinLength(1).annotate({
260
+ expected: "a value with a length of at least 1",
261
+ }),
262
+ )
263
+ .check(
264
+ Schema.isMaxCodePoints(128).annotate({
265
+ expected: "a string with at most 128 code points",
266
+ }),
267
+ )
268
+ .check(
269
+ Schema.isPattern(new globalThis.RegExp("[\\w._-]+", "u")).annotate({
270
+ expected: "a string matching the RegExp [\\w._-]+",
271
+ }),
272
+ ),
273
+ ),
274
+ SamlMetadataDocument: Schema.optionalKey(
275
+ Schema.String.check(
276
+ Schema.isMinCodePoints(1000).annotate({
277
+ expected: "a string with at least 1000 code points",
278
+ }),
279
+ ).check(
280
+ Schema.isMaxCodePoints(10000000).annotate({
281
+ expected: "a string with at most 10000000 code points",
282
+ }),
283
+ ),
284
+ ),
285
+ Tags: Schema.optionalKey(Schema.Array(Tag)),
286
+ AssertionEncryptionMode: Schema.optionalKey(
287
+ Schema.Literals(["Allowed", "Required"]).annotate({
288
+ description: "The encryption setting for the SAML provider",
289
+ }),
290
+ ),
291
+ AddPrivateKey: Schema.optionalKey(
292
+ Schema.String.annotate({
293
+ description: "The private key from your external identity provider",
294
+ })
295
+ .check(
296
+ Schema.isMinLength(1).annotate({
297
+ expected: "a value with a length of at least 1",
298
+ }),
299
+ )
300
+ .check(
301
+ Schema.isMaxCodePoints(16384).annotate({
302
+ expected: "a string with at most 16384 code points",
303
+ }),
304
+ )
305
+ .check(
306
+ Schema.isPattern(
307
+ new globalThis.RegExp("[\\u0009\\u000A\\u000D\\u0020-\\u00FF]+", "u"),
308
+ ).annotate({
309
+ expected:
310
+ "a string matching the RegExp [\\u0009\\u000A\\u000D\\u0020-\\u00FF]+",
311
+ }),
312
+ ),
313
+ ),
314
+ RemovePrivateKey: Schema.optionalKey(
315
+ Schema.String.annotate({
316
+ description: "The Key ID of the private key to remove",
317
+ })
318
+ .check(
319
+ Schema.isMinCodePoints(22).annotate({
320
+ expected: "a string with at least 22 code points",
321
+ }),
322
+ )
323
+ .check(
324
+ Schema.isMaxCodePoints(64).annotate({
325
+ expected: "a string with at most 64 code points",
326
+ }),
327
+ )
328
+ .check(
329
+ Schema.isPattern(new globalThis.RegExp("[A-Z0-9]+", "u")).annotate({
330
+ expected: "a string matching the RegExp [A-Z0-9]+",
331
+ }),
332
+ ),
333
+ ),
334
+ PrivateKeyList: Schema.optionalKey(
335
+ Schema.Array(SAMLPrivateKey).check(
336
+ Schema.isMaxLength(2).annotate({
337
+ expected: "a value with a length of at most 2",
338
+ }),
339
+ ),
340
+ ),
341
+ });
342
+
343
+ /**
344
+ * The AWSSAMLProviderRelationshipIssues array lists inputs that can use several outputs
345
+ * from one source type. Each input retains its provider value until a reviewed
346
+ * mapping chooses an output.
347
+ */
348
+ export const AWSSAMLProviderRelationshipIssues = [];
349
+
350
+ export const AWSSAMLProviderResourceTypeSchema = Schema.Struct({
351
+ provider: Schema.Literal("aws"),
352
+ service: Schema.Literal("iam"),
353
+ resource: Schema.Literal("samlprovider"),
354
+ });
355
+
356
+ /**
357
+ * The AWSSAMLProviderResource class retains its owning stack across declarations.
358
+ * Applied output properties are ordinary values maintained by the lifecycle.
359
+ */
360
+ export class AWSSAMLProviderResource<
361
+ Props = AWSSAMLProviderProps,
362
+ > extends ResourceEntity<{
363
+ readonly provider: "aws";
364
+ readonly service: "iam";
365
+ readonly resource: "samlprovider";
366
+ }> {
367
+ constructor(
368
+ key: ResourceKey,
369
+ readonly props: Props,
370
+ private readonly binding?: ResourceOutputBinding,
371
+ ) {
372
+ super({
373
+ key,
374
+ resourceType: {
375
+ provider: "aws",
376
+ service: "iam",
377
+ resource: "samlprovider",
378
+ },
379
+ });
380
+ }
381
+
382
+ /**
383
+ * Successful lifecycle writes update this value for declarations owned by the stack.
384
+ * Reading an unavailable value throws ResourceOutputResolutionMissing.
385
+ */
386
+ get Arn(): Required<AWSSAMLProviderOutputs>["Arn"] {
387
+ const value: Required<AWSSAMLProviderOutputs>["Arn"] =
388
+ ResourceOutputBinding.value(
389
+ this.binding,
390
+ this.key,
391
+ "Arn",
392
+ Schema.requiredKey(AWSSAMLProviderOutputsSchema.fields.Arn),
393
+ );
394
+ return value;
395
+ }
396
+
397
+ /**
398
+ * Successful lifecycle writes update this value for declarations owned by the stack.
399
+ * Reading an unavailable value throws ResourceOutputResolutionMissing.
400
+ */
401
+ get SamlProviderUUID(): Required<AWSSAMLProviderOutputs>["SamlProviderUUID"] {
402
+ const value: Required<AWSSAMLProviderOutputs>["SamlProviderUUID"] =
403
+ ResourceOutputBinding.value(
404
+ this.binding,
405
+ this.key,
406
+ "SamlProviderUUID",
407
+ Schema.requiredKey(
408
+ AWSSAMLProviderOutputsSchema.fields.SamlProviderUUID,
409
+ ),
410
+ );
411
+ return value;
412
+ }
413
+ }
414
+
415
+ /**
416
+ * Callers must validate properties before constructing the declaration.
417
+ * Compatible resources can depend on it before apply supplies provider values.
418
+ * Reading applied outputs requires a binding to the owning stack.
419
+ */
420
+ export function createAWSSAMLProviderDeclaration<Props>(
421
+ key: ResourceKey,
422
+ props: Props,
423
+ binding?: ResourceOutputBinding,
424
+ ): AWSSAMLProviderResource<Props> {
425
+ const resource: AWSSAMLProviderResource<Props> =
426
+ new AWSSAMLProviderResource<Props>(key, props, binding);
427
+
428
+ return resource;
429
+ }
430
+
431
+ /**
432
+ * The AWSSAMLProvider resource factory registers a validated declaration in the
433
+ * stack graph. Its outputs become available after apply saves the resource.
434
+ */
435
+ export const AWSSAMLProvider = Effect.fn("AWSSAMLProvider")(function* (input: {
436
+ logicalId: string;
437
+ props: AWSSAMLProviderProps;
438
+ }) {
439
+ const graph = yield* ResourceGraphBuilder;
440
+
441
+ const key: ResourceKey = { logicalId: input.logicalId };
442
+
443
+ const declaration = yield* graph.resource(key);
444
+
445
+ const props = yield* Schema.decodeEffect(AWSSAMLProviderPropsSchema)(
446
+ input.props,
447
+ );
448
+
449
+ yield* declaration.registerEntity(AWSSAMLProviderResourceTypeSchema, {
450
+ propsSchema: AWSSAMLProviderPropsSchema,
451
+ requestSchema: AWSSAMLProviderRequestSchema,
452
+ outputsSchema: AWSSAMLProviderOutputsSchema,
453
+ props,
454
+ });
455
+
456
+ const resource: AWSSAMLProviderResource = createAWSSAMLProviderDeclaration(
457
+ key,
458
+ props,
459
+ declaration.outputs,
460
+ );
461
+
462
+ return resource;
463
+ });