@stacksjs/ts-cloud-aws-types 0.1.1
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.
- package/LICENSE.md +21 -0
- package/README.md +321 -0
- package/package.json +27 -0
- package/src/acm.ts +20 -0
- package/src/alb.ts +73 -0
- package/src/apigateway.ts +85 -0
- package/src/appsync.ts +246 -0
- package/src/athena.ts +102 -0
- package/src/autoscaling.ts +201 -0
- package/src/backup.ts +187 -0
- package/src/cloudwatch.ts +98 -0
- package/src/codedeploy.ts +132 -0
- package/src/cognito.ts +216 -0
- package/src/common.ts +20 -0
- package/src/connect.ts +243 -0
- package/src/dynamodb.ts +64 -0
- package/src/ec2.ts +171 -0
- package/src/ecr.ts +129 -0
- package/src/ecs.ts +129 -0
- package/src/efs.ts +57 -0
- package/src/elasticache.ts +92 -0
- package/src/eventbridge.ts +140 -0
- package/src/globalaccelerator.ts +57 -0
- package/src/glue.ts +241 -0
- package/src/iam.ts +142 -0
- package/src/index.ts +328 -0
- package/src/kinesis.ts +261 -0
- package/src/kms.ts +35 -0
- package/src/lambda.ts +42 -0
- package/src/opensearch.ts +147 -0
- package/src/pinpoint.ts +438 -0
- package/src/rds-proxy.ts +67 -0
- package/src/rds.ts +61 -0
- package/src/route53.ts +32 -0
- package/src/secrets-manager.ts +110 -0
- package/src/ses.ts +66 -0
- package/src/sns.ts +45 -0
- package/src/sqs.ts +54 -0
- package/src/ssm.ts +268 -0
- package/src/waf.ts +81 -0
- package/tsconfig.json +12 -0
package/src/backup.ts
ADDED
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AWS Backup Types
|
|
3
|
+
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/AWS_Backup.html
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { Tag } from './common'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* AWS::Backup::BackupVault
|
|
10
|
+
*/
|
|
11
|
+
export interface BackupVault {
|
|
12
|
+
Type: 'AWS::Backup::BackupVault'
|
|
13
|
+
Properties: {
|
|
14
|
+
BackupVaultName: string
|
|
15
|
+
BackupVaultTags?: Record<string, string>
|
|
16
|
+
EncryptionKeyArn?: string
|
|
17
|
+
Notifications?: {
|
|
18
|
+
SNSTopicArn: string
|
|
19
|
+
BackupVaultEvents: Array<'BACKUP_JOB_STARTED' | 'BACKUP_JOB_COMPLETED' | 'BACKUP_JOB_SUCCESSFUL' | 'BACKUP_JOB_FAILED' | 'BACKUP_JOB_EXPIRED' | 'RESTORE_JOB_STARTED' | 'RESTORE_JOB_COMPLETED' | 'RESTORE_JOB_SUCCESSFUL' | 'RESTORE_JOB_FAILED' | 'COPY_JOB_STARTED' | 'COPY_JOB_SUCCESSFUL' | 'COPY_JOB_FAILED' | 'RECOVERY_POINT_MODIFIED' | 'BACKUP_PLAN_CREATED' | 'BACKUP_PLAN_MODIFIED' | 'S3_BACKUP_OBJECT_FAILED' | 'S3_RESTORE_OBJECT_FAILED'>
|
|
20
|
+
}
|
|
21
|
+
AccessPolicy?: {
|
|
22
|
+
Version: string
|
|
23
|
+
Statement: Array<{
|
|
24
|
+
Sid?: string
|
|
25
|
+
Effect: 'Allow' | 'Deny'
|
|
26
|
+
Principal: any
|
|
27
|
+
Action: string | string[]
|
|
28
|
+
Resource?: string | string[]
|
|
29
|
+
Condition?: Record<string, any>
|
|
30
|
+
}>
|
|
31
|
+
}
|
|
32
|
+
LockConfiguration?: {
|
|
33
|
+
MinRetentionDays: number
|
|
34
|
+
MaxRetentionDays?: number
|
|
35
|
+
ChangeableForDays?: number
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* AWS::Backup::BackupPlan
|
|
42
|
+
*/
|
|
43
|
+
export interface BackupPlan {
|
|
44
|
+
Type: 'AWS::Backup::BackupPlan'
|
|
45
|
+
Properties: {
|
|
46
|
+
BackupPlan: {
|
|
47
|
+
BackupPlanName: string
|
|
48
|
+
BackupPlanRule: Array<{
|
|
49
|
+
RuleName: string
|
|
50
|
+
TargetBackupVault: string | { Ref: string }
|
|
51
|
+
ScheduleExpression?: string
|
|
52
|
+
ScheduleExpressionTimezone?: string
|
|
53
|
+
StartWindowMinutes?: number
|
|
54
|
+
CompletionWindowMinutes?: number
|
|
55
|
+
Lifecycle?: {
|
|
56
|
+
DeleteAfterDays?: number
|
|
57
|
+
MoveToColdStorageAfterDays?: number
|
|
58
|
+
OptInToArchiveForSupportedResources?: boolean
|
|
59
|
+
}
|
|
60
|
+
RecoveryPointTags?: Record<string, string>
|
|
61
|
+
CopyActions?: Array<{
|
|
62
|
+
DestinationBackupVaultArn: string
|
|
63
|
+
Lifecycle?: {
|
|
64
|
+
DeleteAfterDays?: number
|
|
65
|
+
MoveToColdStorageAfterDays?: number
|
|
66
|
+
OptInToArchiveForSupportedResources?: boolean
|
|
67
|
+
}
|
|
68
|
+
}>
|
|
69
|
+
EnableContinuousBackup?: boolean
|
|
70
|
+
}>
|
|
71
|
+
AdvancedBackupSettings?: Array<{
|
|
72
|
+
BackupOptions: Record<string, string>
|
|
73
|
+
ResourceType: string
|
|
74
|
+
}>
|
|
75
|
+
}
|
|
76
|
+
BackupPlanTags?: Record<string, string>
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* AWS::Backup::BackupSelection
|
|
82
|
+
*/
|
|
83
|
+
export interface BackupSelection {
|
|
84
|
+
Type: 'AWS::Backup::BackupSelection'
|
|
85
|
+
Properties: {
|
|
86
|
+
BackupPlanId: string | { Ref: string }
|
|
87
|
+
BackupSelection: {
|
|
88
|
+
SelectionName: string
|
|
89
|
+
IamRoleArn: string | { 'Fn::GetAtt': [string, string] }
|
|
90
|
+
Resources?: string[]
|
|
91
|
+
ListOfTags?: Array<{
|
|
92
|
+
ConditionType: 'STRINGEQUALS'
|
|
93
|
+
ConditionKey: string
|
|
94
|
+
ConditionValue: string
|
|
95
|
+
}>
|
|
96
|
+
NotResources?: string[]
|
|
97
|
+
Conditions?: {
|
|
98
|
+
StringEquals?: Array<{
|
|
99
|
+
ConditionKey: string
|
|
100
|
+
ConditionValue: string
|
|
101
|
+
}>
|
|
102
|
+
StringNotEquals?: Array<{
|
|
103
|
+
ConditionKey: string
|
|
104
|
+
ConditionValue: string
|
|
105
|
+
}>
|
|
106
|
+
StringLike?: Array<{
|
|
107
|
+
ConditionKey: string
|
|
108
|
+
ConditionValue: string
|
|
109
|
+
}>
|
|
110
|
+
StringNotLike?: Array<{
|
|
111
|
+
ConditionKey: string
|
|
112
|
+
ConditionValue: string
|
|
113
|
+
}>
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* AWS::Backup::Framework
|
|
121
|
+
*/
|
|
122
|
+
export interface BackupFramework {
|
|
123
|
+
Type: 'AWS::Backup::Framework'
|
|
124
|
+
Properties: {
|
|
125
|
+
FrameworkName?: string
|
|
126
|
+
FrameworkDescription?: string
|
|
127
|
+
FrameworkControls: Array<{
|
|
128
|
+
ControlName: string
|
|
129
|
+
ControlInputParameters?: Array<{
|
|
130
|
+
ParameterName: string
|
|
131
|
+
ParameterValue: string
|
|
132
|
+
}>
|
|
133
|
+
ControlScope?: {
|
|
134
|
+
ComplianceResourceIds?: string[]
|
|
135
|
+
ComplianceResourceTypes?: string[]
|
|
136
|
+
Tags?: Array<{
|
|
137
|
+
Key: string
|
|
138
|
+
Value: string
|
|
139
|
+
}>
|
|
140
|
+
}
|
|
141
|
+
}>
|
|
142
|
+
FrameworkTags?: Tag[]
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* AWS::Backup::ReportPlan
|
|
148
|
+
*/
|
|
149
|
+
export interface BackupReportPlan {
|
|
150
|
+
Type: 'AWS::Backup::ReportPlan'
|
|
151
|
+
Properties: {
|
|
152
|
+
ReportPlanName?: string
|
|
153
|
+
ReportPlanDescription?: string
|
|
154
|
+
ReportDeliveryChannel: {
|
|
155
|
+
S3BucketName: string
|
|
156
|
+
S3KeyPrefix?: string
|
|
157
|
+
Formats?: string[]
|
|
158
|
+
}
|
|
159
|
+
ReportSetting: {
|
|
160
|
+
ReportTemplate: string
|
|
161
|
+
FrameworkArns?: string[]
|
|
162
|
+
Accounts?: string[]
|
|
163
|
+
OrganizationUnits?: string[]
|
|
164
|
+
Regions?: string[]
|
|
165
|
+
}
|
|
166
|
+
ReportPlanTags?: Tag[]
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* AWS::Backup::BackupVaultNotifications (Legacy)
|
|
172
|
+
*/
|
|
173
|
+
export interface BackupVaultNotifications {
|
|
174
|
+
Type: 'AWS::Backup::BackupVault'
|
|
175
|
+
Properties: {
|
|
176
|
+
BackupVaultName: string
|
|
177
|
+
SNSTopicArn: string
|
|
178
|
+
BackupVaultEvents: Array<'BACKUP_JOB_STARTED' | 'BACKUP_JOB_COMPLETED' | 'RESTORE_JOB_STARTED' | 'RESTORE_JOB_COMPLETED' | 'COPY_JOB_STARTED' | 'COPY_JOB_SUCCESSFUL' | 'COPY_JOB_FAILED' | 'RECOVERY_POINT_MODIFIED'>
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export type BackupResource =
|
|
183
|
+
| BackupVault
|
|
184
|
+
| BackupPlan
|
|
185
|
+
| BackupSelection
|
|
186
|
+
| BackupFramework
|
|
187
|
+
| BackupReportPlan
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { CloudFormationResource } from './index'
|
|
2
|
+
|
|
3
|
+
export interface CloudWatchAlarm extends CloudFormationResource {
|
|
4
|
+
Type: 'AWS::CloudWatch::Alarm'
|
|
5
|
+
Properties: {
|
|
6
|
+
AlarmName?: string
|
|
7
|
+
AlarmDescription?: string
|
|
8
|
+
MetricName?: string
|
|
9
|
+
Namespace?: string
|
|
10
|
+
Statistic?: 'SampleCount' | 'Average' | 'Sum' | 'Minimum' | 'Maximum'
|
|
11
|
+
Period?: number
|
|
12
|
+
EvaluationPeriods: number
|
|
13
|
+
Threshold: number
|
|
14
|
+
ComparisonOperator: 'GreaterThanOrEqualToThreshold' | 'GreaterThanThreshold' | 'LessThanThreshold' | 'LessThanOrEqualToThreshold'
|
|
15
|
+
ActionsEnabled?: boolean
|
|
16
|
+
AlarmActions?: string[]
|
|
17
|
+
InsufficientDataActions?: string[]
|
|
18
|
+
OKActions?: string[]
|
|
19
|
+
Dimensions?: Array<{
|
|
20
|
+
Name: string
|
|
21
|
+
Value: string
|
|
22
|
+
}>
|
|
23
|
+
TreatMissingData?: 'breaching' | 'notBreaching' | 'ignore' | 'missing'
|
|
24
|
+
/** Unit of the metric (e.g., 'Seconds', 'Bytes', 'Count') */
|
|
25
|
+
Unit?: string
|
|
26
|
+
/** Number of datapoints that must be breaching to trigger the alarm */
|
|
27
|
+
DatapointsToAlarm?: number
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface CloudWatchLogGroup extends CloudFormationResource {
|
|
32
|
+
Type: 'AWS::Logs::LogGroup'
|
|
33
|
+
Properties?: {
|
|
34
|
+
LogGroupName?: string
|
|
35
|
+
RetentionInDays?: 1 | 3 | 5 | 7 | 14 | 30 | 60 | 90 | 120 | 150 | 180 | 365 | 400 | 545 | 731 | 1827 | 3653
|
|
36
|
+
KmsKeyId?: string
|
|
37
|
+
Tags?: Array<{
|
|
38
|
+
Key: string
|
|
39
|
+
Value: string
|
|
40
|
+
}>
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface CloudWatchDashboard extends CloudFormationResource {
|
|
45
|
+
Type: 'AWS::CloudWatch::Dashboard'
|
|
46
|
+
Properties: {
|
|
47
|
+
DashboardName?: string
|
|
48
|
+
DashboardBody: string
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface CloudWatchLogStream extends CloudFormationResource {
|
|
53
|
+
Type: 'AWS::Logs::LogStream'
|
|
54
|
+
Properties: {
|
|
55
|
+
LogGroupName: string | { Ref: string }
|
|
56
|
+
LogStreamName?: string
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface CloudWatchMetricFilter extends CloudFormationResource {
|
|
61
|
+
Type: 'AWS::Logs::MetricFilter'
|
|
62
|
+
Properties: {
|
|
63
|
+
LogGroupName: string | { Ref: string }
|
|
64
|
+
FilterPattern: string
|
|
65
|
+
MetricTransformations: Array<{
|
|
66
|
+
MetricName: string
|
|
67
|
+
MetricNamespace: string
|
|
68
|
+
MetricValue: string
|
|
69
|
+
DefaultValue?: number
|
|
70
|
+
Unit?: string
|
|
71
|
+
Dimensions?: Array<{
|
|
72
|
+
Key: string
|
|
73
|
+
Value: string
|
|
74
|
+
}>
|
|
75
|
+
}>
|
|
76
|
+
FilterName?: string
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface CloudWatchCompositeAlarm extends CloudFormationResource {
|
|
81
|
+
Type: 'AWS::CloudWatch::CompositeAlarm'
|
|
82
|
+
Properties: {
|
|
83
|
+
AlarmName: string
|
|
84
|
+
AlarmRule: string
|
|
85
|
+
AlarmDescription?: string
|
|
86
|
+
ActionsEnabled?: boolean
|
|
87
|
+
AlarmActions?: string[]
|
|
88
|
+
InsufficientDataActions?: string[]
|
|
89
|
+
OKActions?: string[]
|
|
90
|
+
ActionsSuppressor?: string
|
|
91
|
+
ActionsSuppressorExtensionPeriod?: number
|
|
92
|
+
ActionsSuppressorWaitPeriod?: number
|
|
93
|
+
Tags?: Array<{
|
|
94
|
+
Key: string
|
|
95
|
+
Value: string
|
|
96
|
+
}>
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AWS CodeDeploy Types
|
|
3
|
+
* CloudFormation resource types for AWS CodeDeploy
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { CloudFormationResource } from './index'
|
|
7
|
+
|
|
8
|
+
export interface CodeDeployApplication extends CloudFormationResource {
|
|
9
|
+
Type: 'AWS::CodeDeploy::Application'
|
|
10
|
+
Properties?: {
|
|
11
|
+
ApplicationName?: string
|
|
12
|
+
ComputePlatform?: 'Server' | 'Lambda' | 'ECS'
|
|
13
|
+
Tags?: Array<{
|
|
14
|
+
Key: string
|
|
15
|
+
Value: string
|
|
16
|
+
}>
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface CodeDeployDeploymentGroup extends CloudFormationResource {
|
|
21
|
+
Type: 'AWS::CodeDeploy::DeploymentGroup'
|
|
22
|
+
Properties: {
|
|
23
|
+
ApplicationName: string | { Ref: string }
|
|
24
|
+
DeploymentGroupName?: string
|
|
25
|
+
ServiceRoleArn: string | { Ref: string } | { 'Fn::GetAtt': [string, string] }
|
|
26
|
+
AutoScalingGroups?: string[]
|
|
27
|
+
Ec2TagFilters?: Array<{
|
|
28
|
+
Key?: string
|
|
29
|
+
Value?: string
|
|
30
|
+
Type?: 'KEY_ONLY' | 'VALUE_ONLY' | 'KEY_AND_VALUE'
|
|
31
|
+
}>
|
|
32
|
+
Ec2TagSet?: {
|
|
33
|
+
Ec2TagSetList?: Array<{
|
|
34
|
+
Ec2TagGroup?: Array<{
|
|
35
|
+
Key?: string
|
|
36
|
+
Value?: string
|
|
37
|
+
Type?: 'KEY_ONLY' | 'VALUE_ONLY' | 'KEY_AND_VALUE'
|
|
38
|
+
}>
|
|
39
|
+
}>
|
|
40
|
+
}
|
|
41
|
+
OnPremisesInstanceTagFilters?: Array<{
|
|
42
|
+
Key?: string
|
|
43
|
+
Value?: string
|
|
44
|
+
Type?: 'KEY_ONLY' | 'VALUE_ONLY' | 'KEY_AND_VALUE'
|
|
45
|
+
}>
|
|
46
|
+
DeploymentConfigName?: string | { Ref: string }
|
|
47
|
+
DeploymentStyle?: {
|
|
48
|
+
DeploymentType?: 'IN_PLACE' | 'BLUE_GREEN'
|
|
49
|
+
DeploymentOption?: 'WITH_TRAFFIC_CONTROL' | 'WITHOUT_TRAFFIC_CONTROL'
|
|
50
|
+
}
|
|
51
|
+
AutoRollbackConfiguration?: {
|
|
52
|
+
Enabled?: boolean
|
|
53
|
+
Events?: ('DEPLOYMENT_FAILURE' | 'DEPLOYMENT_STOP_ON_ALARM' | 'DEPLOYMENT_STOP_ON_REQUEST')[]
|
|
54
|
+
}
|
|
55
|
+
AlarmConfiguration?: {
|
|
56
|
+
Enabled?: boolean
|
|
57
|
+
Alarms?: Array<{
|
|
58
|
+
Name?: string
|
|
59
|
+
}>
|
|
60
|
+
IgnorePollAlarmFailure?: boolean
|
|
61
|
+
}
|
|
62
|
+
LoadBalancerInfo?: {
|
|
63
|
+
TargetGroupInfoList?: Array<{
|
|
64
|
+
Name?: string
|
|
65
|
+
}>
|
|
66
|
+
ElbInfoList?: Array<{
|
|
67
|
+
Name?: string
|
|
68
|
+
}>
|
|
69
|
+
TargetGroupPairInfoList?: Array<{
|
|
70
|
+
TargetGroups?: Array<{
|
|
71
|
+
Name?: string
|
|
72
|
+
}>
|
|
73
|
+
ProdTrafficRoute?: {
|
|
74
|
+
ListenerArns?: string[]
|
|
75
|
+
}
|
|
76
|
+
TestTrafficRoute?: {
|
|
77
|
+
ListenerArns?: string[]
|
|
78
|
+
}
|
|
79
|
+
}>
|
|
80
|
+
}
|
|
81
|
+
BlueGreenDeploymentConfiguration?: {
|
|
82
|
+
TerminateBlueInstancesOnDeploymentSuccess?: {
|
|
83
|
+
Action?: 'TERMINATE' | 'KEEP_ALIVE'
|
|
84
|
+
TerminationWaitTimeInMinutes?: number
|
|
85
|
+
}
|
|
86
|
+
DeploymentReadyOption?: {
|
|
87
|
+
ActionOnTimeout?: 'CONTINUE_DEPLOYMENT' | 'STOP_DEPLOYMENT'
|
|
88
|
+
WaitTimeInMinutes?: number
|
|
89
|
+
}
|
|
90
|
+
GreenFleetProvisioningOption?: {
|
|
91
|
+
Action?: 'DISCOVER_EXISTING' | 'COPY_AUTO_SCALING_GROUP'
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
TriggerConfigurations?: Array<{
|
|
95
|
+
TriggerName?: string
|
|
96
|
+
TriggerTargetArn?: string
|
|
97
|
+
TriggerEvents?: string[]
|
|
98
|
+
}>
|
|
99
|
+
ECSServices?: Array<{
|
|
100
|
+
ClusterName: string
|
|
101
|
+
ServiceName: string
|
|
102
|
+
}>
|
|
103
|
+
OutdatedInstancesStrategy?: 'UPDATE' | 'IGNORE'
|
|
104
|
+
Tags?: Array<{
|
|
105
|
+
Key: string
|
|
106
|
+
Value: string
|
|
107
|
+
}>
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export interface CodeDeployDeploymentConfig extends CloudFormationResource {
|
|
112
|
+
Type: 'AWS::CodeDeploy::DeploymentConfig'
|
|
113
|
+
Properties?: {
|
|
114
|
+
DeploymentConfigName?: string
|
|
115
|
+
ComputePlatform?: 'Server' | 'Lambda' | 'ECS'
|
|
116
|
+
MinimumHealthyHosts?: {
|
|
117
|
+
Type: 'HOST_COUNT' | 'FLEET_PERCENT'
|
|
118
|
+
Value: number
|
|
119
|
+
}
|
|
120
|
+
TrafficRoutingConfig?: {
|
|
121
|
+
Type: 'TimeBasedCanary' | 'TimeBasedLinear' | 'AllAtOnce'
|
|
122
|
+
TimeBasedCanary?: {
|
|
123
|
+
CanaryPercentage: number
|
|
124
|
+
CanaryInterval: number
|
|
125
|
+
}
|
|
126
|
+
TimeBasedLinear?: {
|
|
127
|
+
LinearPercentage: number
|
|
128
|
+
LinearInterval: number
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
package/src/cognito.ts
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AWS Cognito Types
|
|
3
|
+
* CloudFormation resource types for Amazon Cognito
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { CloudFormationResource } from './index'
|
|
7
|
+
|
|
8
|
+
export interface CognitoUserPool extends CloudFormationResource {
|
|
9
|
+
Type: 'AWS::Cognito::UserPool'
|
|
10
|
+
Properties?: {
|
|
11
|
+
UserPoolName?: string
|
|
12
|
+
Policies?: {
|
|
13
|
+
PasswordPolicy?: {
|
|
14
|
+
MinimumLength?: number
|
|
15
|
+
RequireLowercase?: boolean
|
|
16
|
+
RequireUppercase?: boolean
|
|
17
|
+
RequireNumbers?: boolean
|
|
18
|
+
RequireSymbols?: boolean
|
|
19
|
+
TemporaryPasswordValidityDays?: number
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
MfaConfiguration?: 'OFF' | 'ON' | 'OPTIONAL'
|
|
23
|
+
UsernameAttributes?: ('email' | 'phone_number')[]
|
|
24
|
+
AutoVerifiedAttributes?: ('email' | 'phone_number')[]
|
|
25
|
+
Schema?: Array<{
|
|
26
|
+
Name: string
|
|
27
|
+
AttributeDataType?: 'String' | 'Number' | 'DateTime' | 'Boolean'
|
|
28
|
+
Required?: boolean
|
|
29
|
+
Mutable?: boolean
|
|
30
|
+
StringAttributeConstraints?: {
|
|
31
|
+
MinLength?: string
|
|
32
|
+
MaxLength?: string
|
|
33
|
+
}
|
|
34
|
+
NumberAttributeConstraints?: {
|
|
35
|
+
MinValue?: string
|
|
36
|
+
MaxValue?: string
|
|
37
|
+
}
|
|
38
|
+
}>
|
|
39
|
+
EmailConfiguration?: {
|
|
40
|
+
EmailSendingAccount?: 'COGNITO_DEFAULT' | 'DEVELOPER'
|
|
41
|
+
From?: string
|
|
42
|
+
ReplyToEmailAddress?: string
|
|
43
|
+
SourceArn?: string
|
|
44
|
+
ConfigurationSet?: string
|
|
45
|
+
}
|
|
46
|
+
SmsConfiguration?: {
|
|
47
|
+
ExternalId?: string
|
|
48
|
+
SnsCallerArn?: string
|
|
49
|
+
}
|
|
50
|
+
LambdaConfig?: {
|
|
51
|
+
PreSignUp?: string
|
|
52
|
+
PostConfirmation?: string
|
|
53
|
+
PreAuthentication?: string
|
|
54
|
+
PostAuthentication?: string
|
|
55
|
+
CustomMessage?: string
|
|
56
|
+
DefineAuthChallenge?: string
|
|
57
|
+
CreateAuthChallenge?: string
|
|
58
|
+
VerifyAuthChallengeResponse?: string
|
|
59
|
+
PreTokenGeneration?: string
|
|
60
|
+
UserMigration?: string
|
|
61
|
+
}
|
|
62
|
+
UserPoolAddOns?: {
|
|
63
|
+
AdvancedSecurityMode?: 'OFF' | 'AUDIT' | 'ENFORCED'
|
|
64
|
+
}
|
|
65
|
+
AccountRecoverySetting?: {
|
|
66
|
+
RecoveryMechanisms?: Array<{
|
|
67
|
+
Name?: 'verified_email' | 'verified_phone_number' | 'admin_only'
|
|
68
|
+
Priority?: number
|
|
69
|
+
}>
|
|
70
|
+
}
|
|
71
|
+
AdminCreateUserConfig?: {
|
|
72
|
+
AllowAdminCreateUserOnly?: boolean
|
|
73
|
+
InviteMessageTemplate?: {
|
|
74
|
+
EmailMessage?: string
|
|
75
|
+
EmailSubject?: string
|
|
76
|
+
SMSMessage?: string
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
Tags?: Array<{
|
|
80
|
+
Key: string
|
|
81
|
+
Value: string
|
|
82
|
+
}>
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface CognitoUserPoolClient extends CloudFormationResource {
|
|
87
|
+
Type: 'AWS::Cognito::UserPoolClient'
|
|
88
|
+
Properties: {
|
|
89
|
+
ClientName?: string
|
|
90
|
+
UserPoolId: string | { Ref: string }
|
|
91
|
+
GenerateSecret?: boolean
|
|
92
|
+
RefreshTokenValidity?: number
|
|
93
|
+
AccessTokenValidity?: number
|
|
94
|
+
IdTokenValidity?: number
|
|
95
|
+
TokenValidityUnits?: {
|
|
96
|
+
RefreshToken?: 'seconds' | 'minutes' | 'hours' | 'days'
|
|
97
|
+
AccessToken?: 'seconds' | 'minutes' | 'hours' | 'days'
|
|
98
|
+
IdToken?: 'seconds' | 'minutes' | 'hours' | 'days'
|
|
99
|
+
}
|
|
100
|
+
ReadAttributes?: string[]
|
|
101
|
+
WriteAttributes?: string[]
|
|
102
|
+
ExplicitAuthFlows?: string[]
|
|
103
|
+
PreventUserExistenceErrors?: 'ENABLED' | 'LEGACY'
|
|
104
|
+
EnableTokenRevocation?: boolean
|
|
105
|
+
CallbackURLs?: string[]
|
|
106
|
+
LogoutURLs?: string[]
|
|
107
|
+
AllowedOAuthFlows?: ('code' | 'implicit' | 'client_credentials')[]
|
|
108
|
+
AllowedOAuthScopes?: string[]
|
|
109
|
+
AllowedOAuthFlowsUserPoolClient?: boolean
|
|
110
|
+
SupportedIdentityProviders?: string[]
|
|
111
|
+
DefaultRedirectURI?: string
|
|
112
|
+
AnalyticsConfiguration?: {
|
|
113
|
+
ApplicationArn?: string
|
|
114
|
+
ApplicationId?: string
|
|
115
|
+
ExternalId?: string
|
|
116
|
+
RoleArn?: string
|
|
117
|
+
UserDataShared?: boolean
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export interface CognitoUserPoolDomain extends CloudFormationResource {
|
|
123
|
+
Type: 'AWS::Cognito::UserPoolDomain'
|
|
124
|
+
Properties: {
|
|
125
|
+
Domain: string
|
|
126
|
+
UserPoolId: string | { Ref: string }
|
|
127
|
+
CustomDomainConfig?: {
|
|
128
|
+
CertificateArn?: string
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export interface CognitoIdentityPool extends CloudFormationResource {
|
|
134
|
+
Type: 'AWS::Cognito::IdentityPool'
|
|
135
|
+
Properties: {
|
|
136
|
+
IdentityPoolName?: string
|
|
137
|
+
AllowUnauthenticatedIdentities: boolean
|
|
138
|
+
CognitoIdentityProviders?: Array<{
|
|
139
|
+
ClientId?: string
|
|
140
|
+
ProviderName?: string
|
|
141
|
+
ServerSideTokenCheck?: boolean
|
|
142
|
+
}>
|
|
143
|
+
SupportedLoginProviders?: Record<string, string>
|
|
144
|
+
SamlProviderARNs?: string[]
|
|
145
|
+
OpenIdConnectProviderARNs?: string[]
|
|
146
|
+
CognitoStreams?: {
|
|
147
|
+
StreamingStatus?: 'ENABLED' | 'DISABLED'
|
|
148
|
+
StreamName?: string
|
|
149
|
+
RoleArn?: string
|
|
150
|
+
}
|
|
151
|
+
PushSync?: {
|
|
152
|
+
ApplicationArns?: string[]
|
|
153
|
+
RoleArn?: string
|
|
154
|
+
}
|
|
155
|
+
CognitoEvents?: Record<string, string>
|
|
156
|
+
DeveloperProviderName?: string
|
|
157
|
+
AllowClassicFlow?: boolean
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export interface CognitoIdentityPoolRoleAttachment extends CloudFormationResource {
|
|
162
|
+
Type: 'AWS::Cognito::IdentityPoolRoleAttachment'
|
|
163
|
+
Properties: {
|
|
164
|
+
IdentityPoolId: string | { Ref: string }
|
|
165
|
+
Roles?: Record<string, string>
|
|
166
|
+
RoleMappings?: Record<string, {
|
|
167
|
+
Type?: 'Token' | 'Rules'
|
|
168
|
+
AmbiguousRoleResolution?: 'AuthenticatedRole' | 'Deny'
|
|
169
|
+
IdentityProvider?: string
|
|
170
|
+
RulesConfiguration?: {
|
|
171
|
+
Rules?: Array<{
|
|
172
|
+
Claim?: string
|
|
173
|
+
MatchType?: 'Equals' | 'Contains' | 'StartsWith' | 'NotEqual'
|
|
174
|
+
Value?: string
|
|
175
|
+
RoleARN?: string
|
|
176
|
+
}>
|
|
177
|
+
}
|
|
178
|
+
}>
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export interface CognitoUserPoolGroup extends CloudFormationResource {
|
|
183
|
+
Type: 'AWS::Cognito::UserPoolGroup'
|
|
184
|
+
Properties: {
|
|
185
|
+
GroupName: string
|
|
186
|
+
UserPoolId: string | { Ref: string }
|
|
187
|
+
Description?: string
|
|
188
|
+
Precedence?: number
|
|
189
|
+
RoleArn?: string
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export interface CognitoUserPoolResourceServer extends CloudFormationResource {
|
|
194
|
+
Type: 'AWS::Cognito::UserPoolResourceServer'
|
|
195
|
+
Properties: {
|
|
196
|
+
Identifier: string
|
|
197
|
+
Name: string
|
|
198
|
+
UserPoolId: string | { Ref: string }
|
|
199
|
+
Scopes?: Array<{
|
|
200
|
+
ScopeName: string
|
|
201
|
+
ScopeDescription: string
|
|
202
|
+
}>
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export interface CognitoUserPoolIdentityProvider extends CloudFormationResource {
|
|
207
|
+
Type: 'AWS::Cognito::UserPoolIdentityProvider'
|
|
208
|
+
Properties: {
|
|
209
|
+
ProviderName: string
|
|
210
|
+
ProviderType: 'SAML' | 'Facebook' | 'Google' | 'LoginWithAmazon' | 'SignInWithApple' | 'OIDC'
|
|
211
|
+
UserPoolId: string | { Ref: string }
|
|
212
|
+
AttributeMapping?: Record<string, string>
|
|
213
|
+
ProviderDetails?: Record<string, string>
|
|
214
|
+
IdpIdentifiers?: string[]
|
|
215
|
+
}
|
|
216
|
+
}
|
package/src/common.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Common AWS Types
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export interface Tag {
|
|
6
|
+
Key: string
|
|
7
|
+
Value: string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type Tags = Tag[]
|
|
11
|
+
|
|
12
|
+
export interface ResourceBase {
|
|
13
|
+
Type: string
|
|
14
|
+
Properties: Record<string, any>
|
|
15
|
+
DependsOn?: string | string[]
|
|
16
|
+
Condition?: string
|
|
17
|
+
DeletionPolicy?: 'Delete' | 'Retain' | 'Snapshot'
|
|
18
|
+
UpdateReplacePolicy?: 'Delete' | 'Retain' | 'Snapshot'
|
|
19
|
+
Metadata?: Record<string, any>
|
|
20
|
+
}
|