def METHOD_NAME(__self__,
             resource_name: str,
             opts: Optional[pulumi.ResourceOptions] = None,
             access_policies: Optional[pulumi.Input[str]] = None,
             domain_name: Optional[pulumi.Input[str]] = None,
             __props__=None):
    opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
    if not isinstance(opts, pulumi.ResourceOptions):
        raise TypeError('Expected resource options to be a ResourceOptions instance')
    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__ = DomainPolicyArgs.__new__(DomainPolicyArgs)
        if access_policies is None and not opts.urn:
            raise TypeError("Missing required property 'access_policies'")
        __props__.__dict__["access_policies"] = access_policies
        if domain_name is None and not opts.urn:
            raise TypeError("Missing required property 'domain_name'")
        __props__.__dict__["domain_name"] = domain_name
    super(DomainPolicy, __self__).__init__(
        'aws:opensearch/domainPolicy:DomainPolicy',
        resource_name,
        __props__,
        opts)