# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables

class AccessPoint(pulumi.CustomResource):
    account_id: pulumi.Output[str]
    arn: pulumi.Output[str]
    """
    Amazon Resource Name (ARN) of the S3 Access Point.
    """
    bucket: pulumi.Output[str]
    """
    The name of the bucket that you want to associate this access point with.
    """
    domain_name: pulumi.Output[str]
    """
    The DNS domain name of the S3 Access Point in the format _`name`_-_`account_id`_.s3-accesspoint._region_.amazonaws.com.
    Note: S3 access points only support secure access by HTTPS. HTTP isn't supported.
    """
    has_public_access_policy: pulumi.Output[bool]
    """
    Indicates whether this access point currently has a policy that allows public access.
    """
    name: pulumi.Output[str]
    """
    The name you want to assign to this access point.
    """
    network_origin: pulumi.Output[str]
    """
    Indicates whether this access point allows access from the public Internet. Values are `VPC` (the access point doesn't allow access from the public Internet) and `Internet` (the access point allows access from the public Internet, subject to the access point and bucket access policies).
    """
    policy: pulumi.Output[str]
    """
    A valid JSON document that specifies the policy that you want to apply to this access point.
    """
    public_access_block_configuration: pulumi.Output[dict]
    """
    Configuration block to manage the `PublicAccessBlock` configuration that you want to apply to this Amazon S3 bucket. You can enable the configuration options in any combination. Detailed below.
    
      * `block_public_acls` (`bool`) - Whether Amazon S3 should block public ACLs for buckets in this account. Defaults to `true`. Enabling this setting does not affect existing policies or ACLs. When set to `true` causes the following behavior:
        * PUT Bucket acl and PUT Object acl calls fail if the specified ACL is public.
        * PUT Object calls fail if the request includes a public ACL.
        * PUT Bucket calls fail if the request includes a public ACL.
      * `block_public_policy` (`bool`) - Whether Amazon S3 should block public bucket policies for buckets in this account. Defaults to `true`. Enabling this setting does not affect existing bucket policies. When set to `true` causes Amazon S3 to:
        * Reject calls to PUT Bucket policy if the specified bucket policy allows public access.
      * `ignore_public_acls` (`bool`) - Whether Amazon S3 should ignore public ACLs for buckets in this account. Defaults to `true`. Enabling this setting does not affect the persistence of any existing ACLs and doesn't prevent new public ACLs from being set. When set to `true` causes Amazon S3 to:
        * Ignore all public ACLs on buckets in this account and any objects that they contain.
      * `restrict_public_buckets` (`bool`) - Whether Amazon S3 should restrict public bucket policies for buckets in this account. Defaults to `true`. Enabling this setting does not affect previously stored bucket policies, except that public and cross-account access within any public bucket policy, including non-public delegation to specific accounts, is blocked. When set to `true`:
        * Only the bucket owner and AWS Services can access buckets with public policies.
    """
    vpc_configuration: pulumi.Output[dict]
    """
    Configuration block to restrict access to this access point to requests from the specified Virtual Private Cloud (VPC). Detailed below.
    
      * `vpc_id` (`str`) - This access point will only allow connections from the specified VPC ID.
    """
    def __init__(__self__, resource_name, opts=None, account_id=None, bucket=None, name=None, policy=None, public_access_block_configuration=None, vpc_configuration=None, __props__=None, __name__=None, __opts__=None):
        """
        Create a AccessPoint resource with the given unique name, props, and options.
        
        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] bucket: The name of the bucket that you want to associate this access point with.
        :param pulumi.Input[str] name: The name you want to assign to this access point.
        :param pulumi.Input[str] policy: A valid JSON document that specifies the policy that you want to apply to this access point.
        :param pulumi.Input[dict] public_access_block_configuration: Configuration block to manage the `PublicAccessBlock` configuration that you want to apply to this Amazon S3 bucket. You can enable the configuration options in any combination. Detailed below.
        :param pulumi.Input[dict] vpc_configuration: Configuration block to restrict access to this access point to requests from the specified Virtual Private Cloud (VPC). Detailed below.
        
        The **public_access_block_configuration** object supports the following:
        
          * `block_public_acls` (`pulumi.Input[bool]`) - Whether Amazon S3 should block public ACLs for buckets in this account. Defaults to `true`. Enabling this setting does not affect existing policies or ACLs. When set to `true` causes the following behavior:
            * PUT Bucket acl and PUT Object acl calls fail if the specified ACL is public.
            * PUT Object calls fail if the request includes a public ACL.
            * PUT Bucket calls fail if the request includes a public ACL.
          * `block_public_policy` (`pulumi.Input[bool]`) - Whether Amazon S3 should block public bucket policies for buckets in this account. Defaults to `true`. Enabling this setting does not affect existing bucket policies. When set to `true` causes Amazon S3 to:
            * Reject calls to PUT Bucket policy if the specified bucket policy allows public access.
          * `ignore_public_acls` (`pulumi.Input[bool]`) - Whether Amazon S3 should ignore public ACLs for buckets in this account. Defaults to `true`. Enabling this setting does not affect the persistence of any existing ACLs and doesn't prevent new public ACLs from being set. When set to `true` causes Amazon S3 to:
            * Ignore all public ACLs on buckets in this account and any objects that they contain.
          * `restrict_public_buckets` (`pulumi.Input[bool]`) - Whether Amazon S3 should restrict public bucket policies for buckets in this account. Defaults to `true`. Enabling this setting does not affect previously stored bucket policies, except that public and cross-account access within any public bucket policy, including non-public delegation to specific accounts, is blocked. When set to `true`:
            * Only the bucket owner and AWS Services can access buckets with public policies.
        
        The **vpc_configuration** object supports the following:
        
          * `vpc_id` (`pulumi.Input[str]`) - This access point will only allow connections from the specified VPC ID.

        > This content is derived from https://github.com/terraform-providers/terraform-provider-aws/blob/master/website/docs/r/s3_access_point.html.markdown.
        """
        if __name__ is not None:
            warnings.warn("explicit use of __name__ is deprecated", DeprecationWarning)
            resource_name = __name__
        if __opts__ is not None:
            warnings.warn("explicit use of __opts__ is deprecated, use 'opts' instead", DeprecationWarning)
            opts = __opts__
        if opts is None:
            opts = pulumi.ResourceOptions()
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.version is None:
            opts.version = utilities.get_version()
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = dict()

            __props__['account_id'] = account_id
            if bucket is None:
                raise TypeError("Missing required property 'bucket'")
            __props__['bucket'] = bucket
            __props__['name'] = name
            __props__['policy'] = policy
            __props__['public_access_block_configuration'] = public_access_block_configuration
            __props__['vpc_configuration'] = vpc_configuration
            __props__['arn'] = None
            __props__['domain_name'] = None
            __props__['has_public_access_policy'] = None
            __props__['network_origin'] = None
        super(AccessPoint, __self__).__init__(
            'aws:s3/accessPoint:AccessPoint',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name, id, opts=None, account_id=None, arn=None, bucket=None, domain_name=None, has_public_access_policy=None, name=None, network_origin=None, policy=None, public_access_block_configuration=None, vpc_configuration=None):
        """
        Get an existing AccessPoint resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.
        
        :param str resource_name: The unique name of the resulting resource.
        :param str id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] arn: Amazon Resource Name (ARN) of the S3 Access Point.
        :param pulumi.Input[str] bucket: The name of the bucket that you want to associate this access point with.
        :param pulumi.Input[str] domain_name: The DNS domain name of the S3 Access Point in the format _`name`_-_`account_id`_.s3-accesspoint._region_.amazonaws.com.
               Note: S3 access points only support secure access by HTTPS. HTTP isn't supported.
        :param pulumi.Input[bool] has_public_access_policy: Indicates whether this access point currently has a policy that allows public access.
        :param pulumi.Input[str] name: The name you want to assign to this access point.
        :param pulumi.Input[str] network_origin: Indicates whether this access point allows access from the public Internet. Values are `VPC` (the access point doesn't allow access from the public Internet) and `Internet` (the access point allows access from the public Internet, subject to the access point and bucket access policies).
        :param pulumi.Input[str] policy: A valid JSON document that specifies the policy that you want to apply to this access point.
        :param pulumi.Input[dict] public_access_block_configuration: Configuration block to manage the `PublicAccessBlock` configuration that you want to apply to this Amazon S3 bucket. You can enable the configuration options in any combination. Detailed below.
        :param pulumi.Input[dict] vpc_configuration: Configuration block to restrict access to this access point to requests from the specified Virtual Private Cloud (VPC). Detailed below.
        
        The **public_access_block_configuration** object supports the following:
        
          * `block_public_acls` (`pulumi.Input[bool]`) - Whether Amazon S3 should block public ACLs for buckets in this account. Defaults to `true`. Enabling this setting does not affect existing policies or ACLs. When set to `true` causes the following behavior:
            * PUT Bucket acl and PUT Object acl calls fail if the specified ACL is public.
            * PUT Object calls fail if the request includes a public ACL.
            * PUT Bucket calls fail if the request includes a public ACL.
          * `block_public_policy` (`pulumi.Input[bool]`) - Whether Amazon S3 should block public bucket policies for buckets in this account. Defaults to `true`. Enabling this setting does not affect existing bucket policies. When set to `true` causes Amazon S3 to:
            * Reject calls to PUT Bucket policy if the specified bucket policy allows public access.
          * `ignore_public_acls` (`pulumi.Input[bool]`) - Whether Amazon S3 should ignore public ACLs for buckets in this account. Defaults to `true`. Enabling this setting does not affect the persistence of any existing ACLs and doesn't prevent new public ACLs from being set. When set to `true` causes Amazon S3 to:
            * Ignore all public ACLs on buckets in this account and any objects that they contain.
          * `restrict_public_buckets` (`pulumi.Input[bool]`) - Whether Amazon S3 should restrict public bucket policies for buckets in this account. Defaults to `true`. Enabling this setting does not affect previously stored bucket policies, except that public and cross-account access within any public bucket policy, including non-public delegation to specific accounts, is blocked. When set to `true`:
            * Only the bucket owner and AWS Services can access buckets with public policies.
        
        The **vpc_configuration** object supports the following:
        
          * `vpc_id` (`pulumi.Input[str]`) - This access point will only allow connections from the specified VPC ID.

        > This content is derived from https://github.com/terraform-providers/terraform-provider-aws/blob/master/website/docs/r/s3_access_point.html.markdown.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()
        __props__["account_id"] = account_id
        __props__["arn"] = arn
        __props__["bucket"] = bucket
        __props__["domain_name"] = domain_name
        __props__["has_public_access_policy"] = has_public_access_policy
        __props__["name"] = name
        __props__["network_origin"] = network_origin
        __props__["policy"] = policy
        __props__["public_access_block_configuration"] = public_access_block_configuration
        __props__["vpc_configuration"] = vpc_configuration
        return AccessPoint(resource_name, opts=opts, __props__=__props__)
    def translate_output_property(self, prop):
        return tables._CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop

    def translate_input_property(self, prop):
        return tables._SNAKE_TO_CAMEL_CASE_TABLE.get(prop) or prop

