Skip to content

Commit

Permalink
Add AWS::Transfer::WebApp handlers (#70)
Browse files Browse the repository at this point in the history
Add resource handler source code for new resource.
  • Loading branch information
www-fu authored Feb 11, 2025
1 parent 28aac84 commit c86314c
Show file tree
Hide file tree
Showing 44 changed files with 3,348 additions and 0 deletions.
25 changes: 25 additions & 0 deletions aws-transfer-webapp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# macOS
.DS_Store
._*

# Maven outputs
.classpath

# IntelliJ
*.iml
.idea
out.java
out/
.settings
.project

# auto-generated files
target/
.hypothesis/
build/

# our logs
rpdk.log*

# contains credentials
sam-tests/
32 changes: 32 additions & 0 deletions aws-transfer-webapp/.rpdk-config
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"artifact_type": "RESOURCE",
"typeName": "AWS::Transfer::WebApp",
"language": "java",
"runtime": "java17",
"entrypoint": "software.amazon.transfer.webapp.HandlerWrapper::handleRequest",
"testEntrypoint": "software.amazon.transfer.webapp.HandlerWrapper::testEntrypoint",
"settings": {
"version": false,
"subparser_name": null,
"verbose": 0,
"force": false,
"type_name": null,
"artifact_type": null,
"endpoint_url": null,
"region": null,
"target_schemas": [],
"profile": null,
"namespace": [
"software",
"amazon",
"transfer",
"webapp"
],
"codegen_template_path": "guided_aws",
"protocolVersion": "2.0.0"
},
"logProcessorEnabled": "true",
"executableEntrypoint": "software.amazon.transfer.webapp.HandlerWrapperExecutable",
"contractSettings": {},
"canarySettings": {}
}
12 changes: 12 additions & 0 deletions aws-transfer-webapp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# AWS::Transfer::WebApp

Congratulations on starting development! Next steps:

1. Write the JSON schema describing your resource, `aws-transfer-webapp.json`
1. Implement your resource handlers.

The RPDK will automatically generate the correct resource model from the schema whenever the project is built via Maven. You can also do this manually with the following command: `cfn generate`.

> Please don't modify files under `target/generated-sources/rpdk`, as they will be automatically overwritten.
The code uses [Lombok](https://projectlombok.org/), and [you may have to install IDE integrations](https://projectlombok.org/setup/overview) to enable auto-complete for Lombok-annotated classes.
229 changes: 229 additions & 0 deletions aws-transfer-webapp/aws-transfer-webapp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,229 @@
{
"typeName": "AWS::Transfer::WebApp",
"description": "Resource Type definition for AWS::Transfer::WebApp",
"definitions": {
"IdentityProviderDetails": {
"type": "object",
"description": "You can provide a structure that contains the details for the identity provider to use with your web app.",
"properties": {
"ApplicationArn": {
"type": "string",
"maxLength": 1224,
"minLength": 10,
"pattern": "^arn:[\\w-]+:sso::\\d{12}:application/(sso)?ins-[a-zA-Z0-9-.]{16}/apl-[a-zA-Z0-9]{16}$"
},
"InstanceArn": {
"type": "string",
"description": "The Amazon Resource Name (ARN) for the IAM Identity Center used for the web app.",
"maxLength": 1224,
"minLength": 10,
"pattern": "^arn:[\\w-]+:sso:::instance/(sso)?ins-[a-zA-Z0-9-.]{16}$"
},
"Role": {
"type": "string",
"description": "The IAM role in IAM Identity Center used for the web app.",
"maxLength": 2048,
"minLength": 20,
"pattern": "^arn:[a-z-]+:iam::[0-9]{12}:role[:/]\\S+$"
}
},
"additionalProperties": false
},
"Tag": {
"type": "object",
"description": "Key-value pair that can be used to group and search for web apps.",
"properties": {
"Key": {
"type": "string",
"maxLength": 128,
"minLength": 0
},
"Value": {
"type": "string",
"maxLength": 256,
"minLength": 0
}
},
"required": [
"Key",
"Value"
],
"additionalProperties": false
},
"WebAppCustomization": {
"type": "object",
"properties": {
"Title": {
"description": "Specifies a title to display on the web app.",
"type": "string",
"maxLength": 100,
"minLength": 0
},
"LogoFile": {
"description": "Specifies a logo to display on the web app.",
"type": "string",
"minLength": 1,
"maxLength": 51200
},
"FaviconFile": {
"description": "Specifies a favicon to display in the browser tab.",
"type": "string",
"minLength": 1,
"maxLength": 20960
}
},
"additionalProperties": false
},
"WebAppUnits": {
"oneOf": [
{
"type": "object",
"description": "A union that contains the value for number of concurrent connections or the user sessions on your web app.",
"title": "Provisioned",
"properties": {
"Provisioned": {
"type": "integer",
"minimum": 1
}
},
"required": [
"Provisioned"
],
"additionalProperties": false
}
]
}
},
"properties": {
"Arn": {
"description": "Specifies the unique Amazon Resource Name (ARN) for the web app.",
"type": "string",
"pattern": "arn:.*",
"minLength": 20,
"maxLength": 1600
},
"WebAppId": {
"description": "A unique identifier for the web app.",
"type": "string",
"pattern": "^webapp-([0-9a-f]{17})$",
"minLength": 24,
"maxLength": 24
},
"IdentityProviderDetails": {
"$ref": "#/definitions/IdentityProviderDetails"
},
"AccessEndpoint": {
"description": "The AccessEndpoint is the URL that you provide to your users for them to interact with the Transfer Family web app. You can specify a custom URL or use the default value.",
"type": "string",
"minLength": 1,
"maxLength": 1024
},
"WebAppUnits": {
"$ref": "#/definitions/WebAppUnits"
},
"WebAppCustomization": {
"$ref": "#/definitions/WebAppCustomization"
},
"Tags": {
"type": "array",
"description": "Key-value pairs that can be used to group and search for web apps.",
"maxItems": 50,
"insertionOrder": false,
"items": {
"$ref": "#/definitions/Tag"
}
}
},
"additionalProperties": false,
"required": [
"IdentityProviderDetails"
],
"readOnlyProperties": [
"/properties/Arn",
"/properties/WebAppId",
"/properties/IdentityProviderDetails/ApplicationArn"
],
"createOnlyProperties": [
"/properties/IdentityProviderDetails/InstanceArn"
],
"primaryIdentifier": [
"/properties/Arn"
],
"additionalIdentifiers": [
[
"/properties/WebAppId"
]
],
"tagging": {
"taggable": true,
"tagOnCreate": true,
"tagUpdatable": true,
"cloudFormationSystemTags": true,
"tagProperty": "/properties/Tags",
"permissions": [
"transfer:TagResource",
"transfer:UnTagResource",
"transfer:ListTagsForResource"
]
},
"handlers": {
"create": {
"permissions": [
"transfer:CreateWebApp",
"transfer:DescribeWebApp",
"transfer:DescribeWebAppCustomization",
"transfer:TagResource",
"transfer:UpdateWebAppCustomization",
"iam:PassRole",
"sso:CreateApplication",
"sso:DescribeApplication",
"sso:ListApplications",
"sso:PutApplicationGrant",
"sso:GetApplicationGrant",
"sso:ListApplicationGrants",
"sso:PutApplicationAuthenticationMethod",
"sso:GetApplicationAuthenticationMethod",
"sso:ListApplicationAuthenticationMethods",
"sso:PutApplicationAccessScope",
"sso:GetApplicationAccessScope",
"sso:ListApplicationAccessScopes"
]
},
"read": {
"permissions": [
"transfer:DescribeWebApp",
"transfer:DescribeWebAppCustomization"
]
},
"update": {
"permissions": [
"transfer:DescribeWebApp",
"transfer:DescribeWebAppCustomization",
"transfer:UpdateWebApp",
"transfer:UpdateWebAppCustomization",
"transfer:DeleteWebAppCustomization",
"transfer:UnTagResource",
"transfer:TagResource",
"iam:PassRole",
"sso:PutApplicationGrant",
"sso:GetApplicationGrant",
"sso:ListApplicationGrants",
"sso:UpdateApplication",
"sso:DescribeApplication",
"sso:ListApplications"
]
},
"delete": {
"permissions": [
"transfer:DeleteWebApp",
"sso:DescribeApplication",
"sso:DeleteApplication"
]
},
"list": {
"permissions": [
"transfer:ListWebApps"
]
}
}
}
Loading

0 comments on commit c86314c

Please sign in to comment.