예제 #1
0
def setup_domain(domain):
    """Configure DOMAIN to point to BUCKET."""
    bucket = domain
    zone = domain_manager.find_hosted_zone(domain) or domain_manager.create_hosted_zone(domain)
    endpoint = util.get_endpoint(bucket_manager.get_region_name(bucket))
    domain_manager.create_s3_domain_record(zone, domain, endpoint)
    print("Domain configured: http://{}".format(domain))
예제 #2
0
 def get_bucket_url(self, bucket):
     """Get the wesite URL for this bucket."""
     return "http://{}.{}".format(
         bucket.name,
         util.get_endpoint(
             self.get_region_name(bucket)
             ).host
         )
예제 #3
0
def setup_domain(domain_name):
    """Configure DOMAIN to point to BUCKET."""
    bucket = bucket_manager.get_bucket(domain_name)
    zone = domain_manager.find_hosted_zone(domain_name) \
        or domain_manager.create_hosted_zone(domain_name)
    endpint = util.get_endpoint(bucket_manager.get_region_name(bucket))
    record = domain_manager.create_s3_domain_record(zone, domain_name, endpint)
    print(record)
예제 #4
0
def setup_domain(domain, bucket):
    """Configure DOMAIN to point to BUCKET."""
    bucket = BUCKET_MANAGER.get_bucket(domain)
    zone = DOMAIN_MANAGER.find_hosted_zone(domain) \
        or DOMAIN_MANAGER.create_hosted_zone(domain)

    endpoint = util.get_endpoint(BUCKET_MANAGER.get_region_name(bucket))
    record = DOMAIN_MANAGER.create_s3_domain_record(zone, domain, endpoint)
    print("Domain configured: http://{}".format(domain))
def setup_domain(domain):
    """Configure a DOMAIN to point to a bucket."""
    bucket = domain
    zone = domain_manager.find_hosted_zone(domain) \
        or domain_manager.create_hosted_zone(domain)

    endpoint = util.get_endpoint(bucket_manager.get_bucket_location(bucket))
    domain_manager.create_s3_domain_record(zone, domain, endpoint)
    print("Domain configured: http://{}".format(domain))
예제 #6
0
def setup_domain(domain):
    """Add custom domain name for bucket website."""
    zone = DOMAIN_MANAGER.find_hosted_zone(domain) \
        or DOMAIN_MANAGER.create_hosted_zone(domain)

    bucket_region = BUCKET_MANAGER.get_bucket_region_name(domain)
    endpoint = util.get_endpoint(bucket_region)
    DOMAIN_MANAGER.create_s3_record(zone, domain, endpoint)
    print("Domain configured: http://{}".format(domain))
예제 #7
0
def setup_domain(domain, bucket):
    """Configure DOMAIN to point to BUCKET"""
    bucket = bucket_manager.get_bucket(domain)

    zone = domain_manager.find_hosted_zone(domain) \
        or domain_manager.create_hosted_zone(domain)

    endpoint = util.get_endpoint(bucket_manager.get_region_name(bucket))
    domain_manager.create_s3_domain_record(zone, domain, endpoint)
    print(f'Domain configured: http://{domain}')
예제 #8
0
def setup_domain(domain):
    """Configure DOMAIN to point to BUCKET."""
    bucket = bucket_manager.get_bucket(domain)
    zone = domain_manager.find_hosted_zone(
        domain) or domain_manager.create_hosted_zone(domain)

    # Get the region name of the bucket
    endpoint = util.get_endpoint(bucket_manager.get_region_name(bucket))
    a_record = domain_manager.create_s3_domain_record(zone, domain, endpoint)
    print(f"Domain configured: http://{a_record}")
예제 #9
0
def setup_domain(domain):
    """Configure R53 Domain to point to S3 Bucket."""
    bucket = bucket_manager.get_bucket(domain)

    zone = domain_manager.find_hosted_zone(domain) \
        or domain_manager.create_hosted_zone(domain)

    endpoint = util.get_endpoint(bucket_manager.get_region_name(bucket))
    domain_manager.create_s3_domain_record(zone, domain, endpoint)
    print("Domain configure: http://{}".format(domain))
예제 #10
0
def setup_domain(domain_name):
    """Configure domain to point to bucket."""
    zone = domain_manager.find_hosted_zone(domain_name) \
            or domain_manager.create_hosted_zone(domain_name)
    # pprint(zone)

    # domain_name is same as bucket_name
    bucket = bucket_manager.get_bucket(domain_name)
    endpoint = util.get_endpoint(bucket_manager.get_region_name_for_bucket(bucket))
    a_record = domain_manager.create_s3_domain_record(zone, domain_name, endpoint)
    print("Domain Configured: http://{}".format(domain_name))
def setup_domain(domain):
    """Configure domain to point to bucket."""
    # get the entire bucket when passing just bucket name to this function
    bucket = bucket_manager.get_bucket(domain)

    zone = domain_manager.find_hosted_zone(domain) \
        or domain_manager.create_hosted_zone(domain)
    # print(zone)
    print("zone = ")
    pprint(zone)
    # endpoint is the domain endpoint for the bucket we're building record for
    endpoint = util.get_endpoint(bucket_manager.get_region_name(bucket))
    a_record = domain_manager.create_s3_domain_record(zone, domain, endpoint)
    # Note - there's no need to do an or-check during domain record creation
    # as upsert either uploads a record if not present or updates if it is
    print("Domain configured:  http://{}".format(domain))
    print("a_record = ")
    pprint(a_record)
 def get_bucket_url(self, bucket_name):
     """Get the website url for this bucekt."""
     return "http://{}.{}".format(
         bucket_name,
         util.get_endpoint(self.get_bucket_location(bucket_name)).host)
예제 #13
0
 def get_bucket_url(self, bucket):
     """Get the website URL  for this bucket"""
     reg_name = self.get_region_name_for_bucket(bucket)
     return "http://{}.{}".format(bucket.name,
                                  util.get_endpoint(reg_name).host)
예제 #14
0
 def get_bucket_url(self, bucket):
     """Get the website URL for this bucket."""
     web_host = util.get_endpoint(self.get_region_name(bucket)).host
     return F"http://{bucket.name}.{web_host}"
예제 #15
0
 def get_bucket_url(self, bucket):
     """Get the bucket URL for this bucket."""
     return "http://" + bucket.name + "." + util.get_endpoint(
         self.get_region_name(bucket)).host
예제 #16
0
 def get_bucket_url(self, s3_bucket):
     """Get website url for this bucket"""
     return "http://{}.{}".format(
         s3_bucket.name,
         util.get_endpoint(self.get_region_name(s3_bucket)).host)
예제 #17
0
 def get_bucket_naked_url(self, bucket):
     """Get the website URL for this bucket without https:// ."""
     #! Lamine: Cloned from 'get_bucket_url' for use in cdn settings
     return "{}.{}".format(
         bucket.name,
         util.get_endpoint(self.get_region_name(bucket)).host)