https://pulumi.com logo
#getting-started
Title
# getting-started
l

limited-arm-77537

01/27/2022, 9:41 AM
Hi, is there any example of creating OpenSearch (aws's elasticsaerch) with Pulumi?
w

wonderful-twilight-70958

01/27/2022, 1:49 PM
I've just done this, lemme find some code. tl;dr you need the native provider.
l

limited-arm-77537

01/27/2022, 1:50 PM
yea, i know, just searching for example
w

wonderful-twilight-70958

01/27/2022, 1:50 PM
Copy code
const opensearchCluster = new awsn.opensearchservice.Domain(`opensearch-cluster-${cluster.name}`, {
    domainName: `os-test-cluster-${cluster.name}`,
    engineVersion: "OpenSearch_1.1",
    clusterConfig: {
      instanceType: "r4.large.search",
      zoneAwarenessEnabled: false,
      instanceCount: 1,
    },
    vPCOptions: {
      subnetIds: [vpcNetwork.getOutput("privateSubnetIds").apply(s => s[0])],
      securityGroupIds: [osSecurityGroup.id],
    },
    eBSOptions: {
      eBSEnabled: true,
      volumeSize: 100,
      volumeType: "gp2",
    },
    accessPolicies: {
      "Version": "2012-10-17",
      "Statement": [{
        "Effect": "Allow",
        "Principal": {"AWS": "*"},
        "Action": "es:ESHttp*",
        "Resource": `arn:aws:es:${aws.config.region}:151743893450:domain/os-test-cluster-${cluster.name}/*`
      }]
    },
    encryptionAtRestOptions: {
      enabled: true,
    },
    nodeToNodeEncryptionOptions: {
      enabled: true,
    },
    domainEndpointOptions: {
      enforceHTTPS: true,
      tLSSecurityPolicy: "Policy-Min-TLS-1-0-2019-07",
    },
    advancedOptions: {
      override_main_response_version: "true",
    },
    advancedSecurityOptions: {
      enabled: true,
      internalUserDatabaseEnabled: true,
      masterUserOptions: {
        masterUserName: "john",
        masterUserPassword: "XXXXXXXXXXXXXXX*",
      }
    }
  })
🙌 1
l

limited-arm-77537

01/27/2022, 1:51 PM
awesome thx!
4 Views