Skip to content

CloudFront

Bases: DuploTenantResourceV3

apply

Apply a service.

create

Create a CloudFront distribution. Usage: Basic CLI Use

duploctl cloudfront create --file cloudfront.yaml
Contents of the cloudfront.yaml file
UseOAIIdentity: true
DistributionConfig:
  DefaultRootObject: "index.html"
  Aliases:
    Items: []
    Quantity: 0
  ViewerCertificate:
    MinimumProtocolVersion:
      Value: "TLSv1.2_2021"
    ACMCertificateArn: ""
    SSLSupportMethod:
      Value: "sni-only"
  Origins:
    Items:
      - DomainName: ""
        Id: ""
    Quantity: 1
  CacheBehaviors:
    Items: []
    Quantity: 0
  CustomErrorResponses:
    Items: []
    Quantity: 0
  Logging:
    Enabled: false
  DefaultCacheBehavior:
    ViewerProtocolPolicy:
      Value: "redirect-to-https"
    LambdaFunctionAssociations:
      Items: []
      Quantity: 0
    Compress: true
    TargetOriginId: ""
    CachePolicyId: ""
  Comment: "duplo-cloudfront"
CorsAllowedHostNames: []
Args: body: The request payload for CloudFront creation. wait: Whether to wait until the distribution is deployed. Returns: dict: The created distribution details.

delete

Delete a CloudFront distribution. Usage:

duploctl cloudfront delete <distribution_id>
Args: distribution_id (str): The ID of the CloudFront distribution to delete. Returns: dict: Confirmation message.

disable

Disable a CloudFront distribution. Usage:

duploctl cloudfront disable <distribution_id>
Args: distribution_id (str): The ID of the CloudFront distribution to be disabled. wait: Whether to wait for the CloudFront distribution to disable. Returns: dict: The service object.

enable

Enable a CloudFront distribution. Usage:

duploctl cloudfront enable <distribution_id>
Args: distribution_id (str): The ID of the CloudFront distribution to be enabled. wait: Whether to wait for the CloudFront distribution to enable. Returns: dict: The service object.

find

Find a CloudFront distribution by its distribution ID. Usage:

duploctl cloudfront find <distribution_id>
Args: distribution_id (str): The CloudFront distribution ID. Returns: dict: The service object.

get_status

Retrieve the status of a CloudFront distribution by its distribution ID. Usage:

duploctl cloudfront get_status <distribution_id>
Args: distribution_id (str): The CloudFront distribution ID. Returns: str: The status of the CloudFront distribution. Raises: DuploError: If the CloudFront distribution could not be found or lacks a status.

list

Retrieve a List of CloudFront resources

cli usage
duploctl cloudfront list

Returns:

Name Type Description
list list

A list of CloudFront.

update

Update a CloudFront distribution. Usage: Basic CLI Use

duploctl cloudfront update --file cloudfront.yaml
Contents of the cloudfront.yaml file
UseOAIIdentity: true
ProcessS3OriginPolicy: true
Id: 
DistributionConfig:
  Aliases:
    Items: []
    Quantity: 0
  CacheBehaviors:
    Items: []
    Quantity: 0
  CallerReference: 
  Comment: duplo-cloudfront
  ContinuousDeploymentPolicyId: ""
  CustomErrorResponses:
    Items: []
    Quantity: 0
  DefaultCacheBehavior:
    AllowedMethods:
      CachedMethods:
        Items:
          - HEAD
          - GET
        Quantity: 2
      Items:
        - HEAD
        - GET
      Quantity: 2
    CachePolicyId: ""
    Compress: true
    FieldLevelEncryptionId: ""
    FunctionAssociations:
      Items: []
      Quantity: 0
    LambdaFunctionAssociations:
      Items: []
      Quantity: 0
    SmoothStreaming: false
    TargetOriginId: 
    TrustedKeyGroups:
      Enabled: false
      Items: []
      Quantity: 0
    TrustedSigners:
      Enabled: false
      Items: []
      Quantity: 0
    ViewerProtocolPolicy:
      Value: redirect-to-https
  DefaultRootObject: main.html
  Enabled: true
  HttpVersion:
    Value: http2
  IsIPV6Enabled: true
  Logging:
    Bucket: ""
    Enabled: false
    IncludeCookies: false
    Prefix: ""
  OriginGroups:
    Items: []
    Quantity: 0
  Origins:
    Items:
      - ConnectionAttempts: 3
        ConnectionTimeout: 10
        CustomHeaders:
          Items: []
          Quantity: 0
        DomainName: ""
        Id: ""
        OriginAccessControlId: ""
        OriginPath: ""
        OriginShield:
          Enabled: false
        S3OriginConfig:
          OriginAccessIdentity: ""
    Quantity: 1
  PriceClass:
    Value: PriceClass_All
  Restrictions:
    GeoRestriction:
      Items: []
      Quantity: 0
      RestrictionType:
        Value: none
  Staging: false
  ViewerCertificate:
    ACMCertificateArn: ""
    Certificate: ""
    CertificateSource:
      Value: acm
    CloudFrontDefaultCertificate: false
    MinimumProtocolVersion:
      Value: TLSv1.2_2021
    SSLSupportMethod:
      Value: sni-only
  WebACLId: ""
Args: body: The request payload for CloudFront updation. wait: Whether to wait until the distribution is deployed. Returns: dict: The updated distribution details.

wait_check

Waits for the CloudFront distribution to be in 'Deployed' status.