AwsCloudfront
Service-level AWS CloudFront component.
Remarks
Naming:
- Root: type
${namespace}:aws:AwsCloudfront; capabilitycloudfront; identity is the raw selected capabilitynamefield; target${env}-${projectHash}-cloudfront-${sanitiseNamePart(identity)}. The target rejects a punctuation-only identity such as___; consumers must select an alphanumeric identity. - Primary children have parent
AwsCloudfrontand tuple containing their selected raw capabilityname:aws:cloudfront/distribution:Distributionand its optionalaws:cloudfront/monitoringSubscription:MonitoringSubscriptionuse[args.distribution.name];aws:cloudfront/function:Functionuses[args.function.name];aws:cloudfront/originAccessControl:OriginAccessControluses[args.originAccessControl.name]; andaws:cloudfront/cachePolicy:CachePolicy,aws:cloudfront/originRequestPolicy:OriginRequestPolicy, andaws:cloudfront/responseHeadersPolicy:ResponseHeadersPolicyuse their correspondingargs.<capability>.name. Each target is${env}-${projectHash}-${sanitiseNamePart(name)}; distinct qualified provider resource types permit identical tuples. - AWS provider names: Function
name(sourceargs.function.name), OriginAccessControlname(sourceargs.originAccessControl.name), and all policynamefields (source their matchingargs.<capability>.name) usestackAndPurpose${env}-${projectHash}-${purpose}throughbuildAwsNameFromLiteralCamelCasePurpose(...), retaining their length limits. Distribution has no controlled provider name:args.distribution.nameis forwarded unchanged only as its default semanticcomment; CloudFront owns provider validation for that comment. MonitoringSubscription has no provider name.
Example
`const distribution = new AwsCloudfront({ distribution: { name: 'website', origins: [{ domainName: 'origin.example.com', originId: 'application', customOriginConfig: { httpPort: 80, httpsPort: 443 } }], defaultCacheBehavior: { targetOriginId: 'application' }, viewerCertificate: { acmCertificateArn: 'arn:aws:acm:us-east-1:000000000000:certificate/12345678-1234-1234-1234-123456789abc' } } });`Constructors
new AwsCloudfront(
args: AwsCloudfrontArgs,
options?: ComponentResourceOptions,
): AwsCloudfront
Parameters
args(AwsCloudfrontArgs)options(ComponentResourceOptions, optional)
Returns
AwsCloudfront
Hierarchy
ComponentResourceAwsCloudfront
Properties
cachePolicy: CachePolicy
Cache policy created by the cache-policy capability.
cachePolicyReference: Output<AwsCloudfrontCachePolicyReference>
Typed cache-policy identifier for cache behaviours.
distribution: Distribution
Distribution created by the distribution capability.
distributionArn: Output<string>
Distribution ARN for dependent resources.
distributionDomainName: Output<string>
CloudFront-managed distribution domain name.
distributionId: Output<string>
Distribution ID for dependent resources.
distributionReference: Output<AwsCloudfrontDistributionReference>
Typed distribution identifiers for dependent infrastructure.
function: Function
Function created by the function capability.
functionArn: Output<string>
ARN of the published CloudFront Function.
monitoringSubscription: MonitoringSubscription
Optional enhanced real-time metrics subscription for the distribution.
originAccessControl: OriginAccessControl
Origin Access Control created by the OAC capability.
originAccessControlReference: Output<AwsCloudfrontOriginAccessControlReference>
Typed OAC identifier for private S3 origins.
originRequestPolicy: OriginRequestPolicy
Origin request policy created by the origin-request-policy capability.
originRequestPolicyReference: Output<AwsCloudfrontOriginRequestPolicyReference>
Typed origin-request-policy identifier for cache behaviours.
responseHeadersPolicy: ResponseHeadersPolicy
Response headers policy created by the response-headers-policy capability.
responseHeadersPolicyReference: Output<AwsCloudfrontResponseHeadersPolicyReference>
Typed response-headers-policy identifier for cache behaviours.
urn: Output<string>
Inherited from urn
The stable logical URN used to distinctly address a resource, both before and after deployments.
Methods
getData(): Promise<any>
Inherited from getData
Retrieves the data produces by initialize. The data is immediately available in a derived class's constructor after the super(...) call to ComponentResource.
Returns
Promise<any>
getProvider(moduleMember: string): ProviderResource | undefined
Inherited from getProvider
Returns the provider for the given module member, if one exists.
Parameters
moduleMember(string)
Returns
ProviderResource | undefined
initialize(
args: Inputs,
opts?: ComponentResourceOptions,
name?: string,
type?: string,
): Promise<any>
Inherited from initialize
Can be overridden by a subclass to asynchronously initialize data for this component automatically when constructed. The data will be available immediately for subclass constructors to use. To access the data use getData.
Parameters
args(Inputs)opts(ComponentResourceOptions, optional)name(string, optional)type(string, optional)
Returns
Promise<any>
registerOutputs(
outputs?: Inputs | Promise<Inputs> | Output<Inputs>,
): void
Inherited from registerOutputs
Registers synthetic outputs that a component has initialized, usually by allocating other child sub-resources and propagating their resulting property values.
Component resources can call this at the end of their constructor to indicate that they are done creating child resources. This is not strictly necessary as this will automatically be called after the initialize method completes.
Parameters
outputs(Inputs | Promise<Inputs> | Output<Inputs>, optional)
Returns
void
Static Methods
isInstance(obj: any): obj is ComponentResource<any>
Inherited from isInstance
Returns true if the given object is a CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.
Parameters
obj(any)
Returns
obj is ComponentResource<any>