Configures the policies that control access to the domain’s document and search services. The maximum size of an access policy document is 100KB.
Access
public
Parameters
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
|
Required |
A string that represents the name of a domain. Domain names must be unique across the domains owned by an account within an AWS region. Domain names must start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen). Uppercase letters and underscores are not allowed. [Constraints: The value must be between 3 and 28 characters, and must match the following regular expression pattern: |
|
|
|
Required |
An IAM access policy as described in The Access Policy Language in Using AWS Identity and Access Management. The maximum size of an access policy document is 100KB. Example: |
|
|
|
Optional |
An associative array of parameters that can have the following keys:
|
Returns
Type |
Description |
|---|---|
|
A |
Examples
Update and describe the service access policies.
// Instantiate the class
$search = new AmazonCloudSearch();
$domain_name = 'my-domain';
/*%**************************************************************%*/
// Create a new CloudSearch domain
echo '# Creating a new CloudSearch domain' . PHP_EOL;
$response = $search->create_domain($domain_name);
// Check for success...
if ($response->isOK())
{
echo 'Kicked off the creation of the CloudSearch domain...' . PHP_EOL;
}
else
{
print_r($response);
}
echo PHP_EOL;
/*%**************************************************************%*/
// Update service access policies
sleep(1);
echo "# Update the service access policies, \"${domain_name}\"" . PHP_EOL;
$response = $search->update_service_access_policies($domain_name, '{my-policy}');
// Check for success...
if ($response->isOK())
{
echo 'Updated the service access policies...' . PHP_EOL;
}
else
{
print_r($response);
}
echo PHP_EOL;
/*%**************************************************************%*/
// Describe service access policies
echo "# Describing the service access policies, \"${domain_name}\"" . PHP_EOL;
$response = $search->describe_service_access_policies($domain_name);
// Check for success...
if ($response->isOK())
{
echo 'Described the service access policies...' . PHP_EOL;
}
else
{
print_r($response);
}
echo PHP_EOL;
/*%**************************************************************%*/
// Delete the CloudSearch domain
echo '# Deleting the CloudSearch domain...' . PHP_EOL;
$response = $search->delete_domain($domain_name);
// Check for success...
if ($response->isOK())
{
echo 'CloudSearch domain was deleted successfully.' . PHP_EOL;
}
else
{
print_r($response);
}
Source
Method defined in services/cloudsearch.class.php | Toggle source view (8 lines) | View on GitHub

