-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from ssennettau/rename
Rename PartySmith to GenStack
- Loading branch information
Showing
23 changed files
with
159 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import * as cdk from 'aws-cdk-lib'; | ||
import { Construct } from 'constructs'; | ||
import * as cloudfront from 'aws-cdk-lib/aws-cloudfront'; | ||
import * as cloudfrontOrigins from 'aws-cdk-lib/aws-cloudfront-origins'; | ||
import * as acm from 'aws-cdk-lib/aws-certificatemanager'; | ||
import * as route53 from 'aws-cdk-lib/aws-route53'; | ||
import * as route53Targets from 'aws-cdk-lib/aws-route53-targets'; | ||
import * as s3 from 'aws-cdk-lib/aws-s3'; | ||
|
||
export interface RedirectionSiteProps { | ||
targetUrl: string; | ||
customDomain?: CustomDomainProps; | ||
} | ||
|
||
interface CustomDomainProps { | ||
domainName: string; | ||
hostedZone: string; | ||
} | ||
|
||
export class RedirectionSite extends Construct { | ||
public readonly cfDistributionUrl: string; | ||
public readonly url: string; | ||
|
||
constructor(scope: Construct, id: string, props: RedirectionSiteProps) { | ||
super(scope, id); | ||
|
||
const hostedZone = props.customDomain ? route53.HostedZone.fromLookup(this, "hostedZone", { | ||
domainName: props.customDomain?.hostedZone, | ||
}) : undefined; | ||
|
||
const distribution = new cloudfront.Distribution(this, "redirectDistribution", { | ||
defaultBehavior: { | ||
origin: new cloudfrontOrigins.S3Origin(new s3.Bucket( | ||
this, "stubBucket", { removalPolicy: cdk.RemovalPolicy.DESTROY })), | ||
viewerProtocolPolicy: cloudfront.ViewerProtocolPolicy.REDIRECT_TO_HTTPS, | ||
responseHeadersPolicy: cloudfront.ResponseHeadersPolicy.CORS_ALLOW_ALL_ORIGINS, | ||
functionAssociations: [{ | ||
function: new cloudfront.Function(this, "redirectFunction", { | ||
code: cloudfront.FunctionCode.fromInline(` | ||
function handler(event) { | ||
var response = { | ||
statusCode: 302, | ||
statusDescription: "Found", | ||
headers: { | ||
'location': { value: "${props.targetUrl}" }, | ||
'cloudfront-functions': { value: "redirect" } | ||
} | ||
}; | ||
return response; | ||
} | ||
`) | ||
}), | ||
eventType: cloudfront.FunctionEventType.VIEWER_REQUEST, | ||
}] | ||
}, | ||
domainNames: props.customDomain ? [props.customDomain?.domainName] : undefined, | ||
certificate: props.customDomain ? new acm.Certificate(this, "redirectCertificate", { | ||
domainName: props.customDomain.domainName, | ||
validation: acm.CertificateValidation.fromDns(hostedZone), | ||
}) : undefined, | ||
minimumProtocolVersion: cloudfront.SecurityPolicyProtocol.TLS_V1_2_2021, | ||
}); | ||
|
||
if (hostedZone) { | ||
const route53Record = new route53.RecordSet(this, "r53record", { | ||
zone: hostedZone, | ||
recordName: props.customDomain?.domainName, | ||
recordType: route53.RecordType.A, | ||
target: route53.RecordTarget.fromAlias(new route53Targets.CloudFrontTarget(distribution)), | ||
}); | ||
} | ||
|
||
this.cfDistributionUrl = `https://${distribution.domainName}`; | ||
this.url = props.customDomain ? `https://${props.customDomain.domainName}` : this.cfDistributionUrl; | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"name": "partysmith", | ||
"name": "genstack", | ||
"version": "1.0.0", | ||
"private": true, | ||
"scripts": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
<main class="flex-grow flex items-center justify-center mb-16"> | ||
<div class="bg-gray-800 p-6 rounded-lg shadow-md max-w-4xl space-y-3"> | ||
<p>PartySmith is an unofficial community project that transforms your <a href="https://partyrock.aws/" class="font-semibold text-yellow-400 hover:text-gray-500" target="_blank">AWS PartyRock</a> apps into deployable full-stack <a href="https://kit.svelte.dev/" class="font-semibold text-yellow-400 hover:text-gray-500" target="_blank">SvelteKit</a> applications.</p> | ||
<p>GenStack is an unofficial community project that transforms your <a href="https://partyrock.aws/" class="font-semibold text-yellow-400 hover:text-gray-500" target="_blank">AWS PartyRock</a> apps into deployable full-stack <a href="https://kit.svelte.dev/" class="font-semibold text-yellow-400 hover:text-gray-500" target="_blank">SvelteKit</a> applications.</p> | ||
|
||
<p>Users can enter the URL of a publicly published PartyRock app, select the desired settings, and PartySmith will forge an application into a ZIP archive which will be downloaded to your machine, and ready for use.</p> | ||
<p>Users can enter the URL of a publicly published PartyRock app, select the desired settings, and GenStack will forge an application into a ZIP archive which will be downloaded to your machine, and ready for use.</p> | ||
|
||
<p>This is designed to help build rapidly-deployable, and highly-customizable experimental apps using the Generative AI services of <a href="https://aws.amazon.com/bedrock" class="font-semibold text-yellow-400 hover:text-gray-500" target="_blank">Amazon Bedrock</a>, which are suitable for use in personal, customer-facing, or internal enterprise use cases.</p> | ||
|
||
<p>You can find out more about how PartySmith works by checking out the article on <a href="https://community.aws/content/2b40sobzGjCjWy9oUjtygY5McjU/partysmith" class="font-semibold text-yellow-400 hover:text-gray-500" target="_blank">Community.AWS</a>, or by visiting the <a href="https://github.com/ssennettau/PartySmith" class="font-semibold text-yellow-400 hover:text-gray-500" target="_blank">PartySmith GitHub Repository</a>.</p> | ||
<p>You can find out more about how GenStack works by checking out the article on <a href="https://community.aws/content/2b40sobzGjCjWy9oUjtygY5McjU/partysmith" class="font-semibold text-yellow-400 hover:text-gray-500" target="_blank">Community.AWS</a>, or by visiting the <a href="https://github.com/ssennettau/GenStack" class="font-semibold text-yellow-400 hover:text-gray-500" target="_blank">GenStack GitHub Repository</a>.</p> | ||
</div> | ||
</main> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"name": "partysmith-app", | ||
"name": "genstack-app", | ||
"version": "0.0.1", | ||
"private": true, | ||
"scripts": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.