ness
Version:
✪ No-effort static sites deployed to your AWS account.
95 lines (94 loc) • 3.47 kB
TypeScript
import { ResourceRecordSet } from '@aws-sdk/client-route-53';
import { DistributionSummary } from '@aws-sdk/client-cloudfront';
export interface HostedZone {
id: string;
name?: string;
}
/**
* Get an existing HostedZone for a given domain
*
* @param domain Domain to lookup
*/
export declare function getHostedZone(domain: string): Promise<HostedZone | undefined>;
/**
* Get record sets from a Route53 hosted zone.
*
* @param hostedZoneId HostedZoneId of the hosted zone that should be cleaned up
*/
export declare function getHostedZoneRecordSets(hostedZoneId: string): Promise<ResourceRecordSet[] | undefined>;
/**
* Get any existing A record for a given hosted zone.
*
* @param hostedZoneId HostedZoneId of the hosted zone that should be cleaned up
*/
export declare function getHostedZoneARecord(hostedZoneId: string, domain: string | undefined): Promise<ResourceRecordSet | undefined>;
/**
* Deletes record sets from a hosted zone.
*
* @param hostedZoneId HostedZoneId of the hosted zone that should be cleaned up
* @param records Record sets to be deleted
*/
export declare function deleteHostedZoneRecords(hostedZoneId: string, records: ResourceRecordSet[]): Promise<void>;
/**
* Clear out any records in a Hosted Zone that were created by validating
* a DNS Validated Certificate through ACM.
*
* @param hostedZoneId HostedZoneId of the hosted zone that should be cleaned up
*/
export declare function cleanupHostedZoneRecords(hostedZoneId: string): Promise<void>;
/**
* Get an existing Cloudfront Distribution for a given domain
*
* @param domain Domain to lookup
*/
export declare function getDistribution(domain: string): Promise<DistributionSummary | undefined>;
export declare function invalidateDistribution(distributionId: string, paths?: string[]): Promise<void>;
/**
* Get an existing certificate ARN for a given domain
*
* @param domain Domain to lookup
*/
export declare function getCertificateArn(domain: string): Promise<string | undefined>;
export declare function getHostedZoneNameservers(hostedZoneId: string): Promise<string[] | undefined>;
export declare type NessStack = 'domain' | 'web' | 'alias' | 'support';
export interface Stack {
/**
* The physical name of this stack.
*/
stackName: string;
/**
* CloudFormation parameters to pass to the stack.
*/
parameters: {
[id: string]: string | undefined;
};
/**
* The stack template.
*/
template: any;
}
export declare function getStack(stack: NessStack, parameters: {
[id: string]: string | undefined;
}): Promise<Stack>;
export interface DeployStackOptions {
/**
* The stack to be deployed
*/
stack: Stack;
}
export declare function deployStack(options: DeployStackOptions): Promise<{
[name: string]: string;
}>;
export declare function deleteCloudFormationStack(stack: string, retain?: string[] | undefined): Promise<void>;
export declare function getCloudFormationStackOutputs(stack: string): Promise<Record<string, string> | undefined>;
export declare function getCloudFormationFailureReason(stack: string): Promise<string | undefined>;
export declare function clearS3Bucket(bucket: string, prefix?: string): Promise<void>;
export declare type SyncProps = {
dir: string;
bucket: string;
prefix?: string;
prune?: boolean;
verbose?: boolean;
cacheControl?: string;
};
export declare function syncLocalToS3(props: SyncProps): Promise<void>;