AWS Classic

Pulumi Official
Package maintained by Pulumi
v5.9.2 published on Friday, Jun 24, 2022 by Pulumi

DomainServiceAccessPolicy

Import

CloudSearch domain service access policies can be imported using the domain name, e.g.,

 $ pulumi import aws:cloudsearch/domainServiceAccessPolicy:DomainServiceAccessPolicy example example-domain

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var exampleDomain = new Aws.CloudSearch.Domain("exampleDomain", new Aws.CloudSearch.DomainArgs
        {
        });
        var exampleDomainServiceAccessPolicy = new Aws.CloudSearch.DomainServiceAccessPolicy("exampleDomainServiceAccessPolicy", new Aws.CloudSearch.DomainServiceAccessPolicyArgs
        {
            DomainName = exampleDomain.Id,
            AccessPolicy = @"{
  ""Version"":""2012-10-17"",
  ""Statement"":[{
    ""Sid"":""search_only"",
    ""Effect"":""Allow"",
    ""Principal"":""*"",
    ""Action"":[
      ""cloudsearch:search"",
      ""cloudsearch:document""
    ],
    ""Condition"":{""IpAddress"":{""aws:SourceIp"":""192.0.2.0/32""}}
  }]
}
",
        });
    }

}
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/cloudsearch"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleDomain, err := cloudsearch.NewDomain(ctx, "exampleDomain", nil)
		if err != nil {
			return err
		}
		_, err = cloudsearch.NewDomainServiceAccessPolicy(ctx, "exampleDomainServiceAccessPolicy", &cloudsearch.DomainServiceAccessPolicyArgs{
			DomainName:   exampleDomain.ID(),
			AccessPolicy: pulumi.String(fmt.Sprintf("%v%v%v%v%v%v%v%v%v%v%v%v%v", "{\n", "  \"Version\":\"2012-10-17\",\n", "  \"Statement\":[{\n", "    \"Sid\":\"search_only\",\n", "    \"Effect\":\"Allow\",\n", "    \"Principal\":\"*\",\n", "    \"Action\":[\n", "      \"cloudsearch:search\",\n", "      \"cloudsearch:document\"\n", "    ],\n", "    \"Condition\":{\"IpAddress\":{\"aws:SourceIp\":\"192.0.2.0/32\"}}\n", "  }]\n", "}\n")),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var exampleDomain = new Domain("exampleDomain");

        var exampleDomainServiceAccessPolicy = new DomainServiceAccessPolicy("exampleDomainServiceAccessPolicy", DomainServiceAccessPolicyArgs.builder()        
            .domainName(exampleDomain.id())
            .accessPolicy("""
{
  "Version":"2012-10-17",
  "Statement":[{
    "Sid":"search_only",
    "Effect":"Allow",
    "Principal":"*",
    "Action":[
      "cloudsearch:search",
      "cloudsearch:document"
    ],
    "Condition":{"IpAddress":{"aws:SourceIp":"192.0.2.0/32"}}
  }]
}
            """)
            .build());

    }
}
import pulumi
import pulumi_aws as aws

example_domain = aws.cloudsearch.Domain("exampleDomain")
example_domain_service_access_policy = aws.cloudsearch.DomainServiceAccessPolicy("exampleDomainServiceAccessPolicy",
    domain_name=example_domain.id,
    access_policy="""{
  "Version":"2012-10-17",
  "Statement":[{
    "Sid":"search_only",
    "Effect":"Allow",
    "Principal":"*",
    "Action":[
      "cloudsearch:search",
      "cloudsearch:document"
    ],
    "Condition":{"IpAddress":{"aws:SourceIp":"192.0.2.0/32"}}
  }]
}
""")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const exampleDomain = new aws.cloudsearch.Domain("exampleDomain", {});
const exampleDomainServiceAccessPolicy = new aws.cloudsearch.DomainServiceAccessPolicy("exampleDomainServiceAccessPolicy", {
    domainName: exampleDomain.id,
    accessPolicy: `{
  "Version":"2012-10-17",
  "Statement":[{
    "Sid":"search_only",
    "Effect":"Allow",
    "Principal":"*",
    "Action":[
      "cloudsearch:search",
      "cloudsearch:document"
    ],
    "Condition":{"IpAddress":{"aws:SourceIp":"192.0.2.0/32"}}
  }]
}
`,
});
resources:
  exampleDomain:
    type: aws:cloudsearch:Domain
  exampleDomainServiceAccessPolicy:
    type: aws:cloudsearch:DomainServiceAccessPolicy
    properties:
      domainName: ${exampleDomain.id}
      accessPolicy: |
        {
          "Version":"2012-10-17",
          "Statement":[{
            "Sid":"search_only",
            "Effect":"Allow",
            "Principal":"*",
            "Action":[
              "cloudsearch:search",
              "cloudsearch:document"
            ],
            "Condition":{"IpAddress":{"aws:SourceIp":"192.0.2.0/32"}}
          }]
        }        

Create a DomainServiceAccessPolicy Resource

new DomainServiceAccessPolicy(name: string, args: DomainServiceAccessPolicyArgs, opts?: CustomResourceOptions);
@overload
def DomainServiceAccessPolicy(resource_name: str,
                              opts: Optional[ResourceOptions] = None,
                              access_policy: Optional[str] = None,
                              domain_name: Optional[str] = None)
@overload
def DomainServiceAccessPolicy(resource_name: str,
                              args: DomainServiceAccessPolicyArgs,
                              opts: Optional[ResourceOptions] = None)
func NewDomainServiceAccessPolicy(ctx *Context, name string, args DomainServiceAccessPolicyArgs, opts ...ResourceOption) (*DomainServiceAccessPolicy, error)
public DomainServiceAccessPolicy(string name, DomainServiceAccessPolicyArgs args, CustomResourceOptions? opts = null)
public DomainServiceAccessPolicy(String name, DomainServiceAccessPolicyArgs args)
public DomainServiceAccessPolicy(String name, DomainServiceAccessPolicyArgs args, CustomResourceOptions options)
type: aws:cloudsearch:DomainServiceAccessPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args DomainServiceAccessPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args DomainServiceAccessPolicyArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args DomainServiceAccessPolicyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args DomainServiceAccessPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args DomainServiceAccessPolicyArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

DomainServiceAccessPolicy Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The DomainServiceAccessPolicy resource accepts the following input properties:

AccessPolicy string

The access rules you want to configure. These rules replace any existing rules. See the AWS documentation for details.

DomainName string

The CloudSearch domain name the policy applies to.

AccessPolicy string

The access rules you want to configure. These rules replace any existing rules. See the AWS documentation for details.

DomainName string

The CloudSearch domain name the policy applies to.

accessPolicy String

The access rules you want to configure. These rules replace any existing rules. See the AWS documentation for details.

domainName String

The CloudSearch domain name the policy applies to.

accessPolicy string

The access rules you want to configure. These rules replace any existing rules. See the AWS documentation for details.

domainName string

The CloudSearch domain name the policy applies to.

access_policy str

The access rules you want to configure. These rules replace any existing rules. See the AWS documentation for details.

domain_name str

The CloudSearch domain name the policy applies to.

accessPolicy String

The access rules you want to configure. These rules replace any existing rules. See the AWS documentation for details.

domainName String

The CloudSearch domain name the policy applies to.

Outputs

All input properties are implicitly available as output properties. Additionally, the DomainServiceAccessPolicy resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up an Existing DomainServiceAccessPolicy Resource

Get an existing DomainServiceAccessPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: DomainServiceAccessPolicyState, opts?: CustomResourceOptions): DomainServiceAccessPolicy
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        access_policy: Optional[str] = None,
        domain_name: Optional[str] = None) -> DomainServiceAccessPolicy
func GetDomainServiceAccessPolicy(ctx *Context, name string, id IDInput, state *DomainServiceAccessPolicyState, opts ...ResourceOption) (*DomainServiceAccessPolicy, error)
public static DomainServiceAccessPolicy Get(string name, Input<string> id, DomainServiceAccessPolicyState? state, CustomResourceOptions? opts = null)
public static DomainServiceAccessPolicy get(String name, Output<String> id, DomainServiceAccessPolicyState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
AccessPolicy string

The access rules you want to configure. These rules replace any existing rules. See the AWS documentation for details.

DomainName string

The CloudSearch domain name the policy applies to.

AccessPolicy string

The access rules you want to configure. These rules replace any existing rules. See the AWS documentation for details.

DomainName string

The CloudSearch domain name the policy applies to.

accessPolicy String

The access rules you want to configure. These rules replace any existing rules. See the AWS documentation for details.

domainName String

The CloudSearch domain name the policy applies to.

accessPolicy string

The access rules you want to configure. These rules replace any existing rules. See the AWS documentation for details.

domainName string

The CloudSearch domain name the policy applies to.

access_policy str

The access rules you want to configure. These rules replace any existing rules. See the AWS documentation for details.

domain_name str

The CloudSearch domain name the policy applies to.

accessPolicy String

The access rules you want to configure. These rules replace any existing rules. See the AWS documentation for details.

domainName String

The CloudSearch domain name the policy applies to.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.