Thread
#getting-started
    l

    limited-arm-77537

    7 months ago
    Hi, is there any example of creating OpenSearch (aws's elasticsaerch) with Pulumi?
    w

    wonderful-twilight-70958

    7 months ago
    I've just done this, lemme find some code. tl;dr you need the native provider.
    l

    limited-arm-77537

    7 months ago
    yea, i know, just searching for example
    w

    wonderful-twilight-70958

    7 months ago
    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*",
          }
        }
      })
    l

    limited-arm-77537

    7 months ago
    awesome thx!