Code Monkey home page Code Monkey logo

Comments (4)

doron276 avatar doron276 commented on June 9, 2024 1

Thanks for the answer @RanVaknin - My mistake.
Thanks for the quick help!

from aws-sdk-go.

RanVaknin avatar RanVaknin commented on June 9, 2024

Hi @doron276 ,

Is it possible to get the Cloud Search domain tags? Please let me know if there is any way.

I answered this on the second issue you opened here.

I get a response without errors but the access policy is empty. For example (see empty value of "Options"):

{
    "AccessPolicies": {
        "Options": "",
        "Status": {
            "CreationDate": "2023-11-30T13:08:23.785000+00:00",
            "UpdateDate": "2023-11-30T13:21:29.655000+00:00",
            "UpdateVersion": 14,
            "State": "Active",
            "PendingDeletion": false
        }
    }
}

It's not clear to me how you are seeing this JSON structure using the Go SDK, as the service responds in XML, not JSON:

  <DescribeServiceAccessPoliciesResult>
    <AccessPolicies>
      <Options>{&quot;Version&quot;:&quot;2012-10-17&quot;,&quot;Statement&quot;:[{&quot;Effect&quot;:&quot;Allow&quot;,&quot;Principal&quot;:{&quot;AWS&quot;:&quot;*&quot;},&quot;Action&quot;:&quot;cloudsearch:*&quot;}]}</Options>
      <Status>
        <UpdateDate>2023-12-04T23:29:00.601Z</UpdateDate>
        <UpdateVersion>5</UpdateVersion>
        <State>Processing</State>
        <CreationDate>2023-12-04T23:29:00.601Z</CreationDate>
        <PendingDeletion>false</PendingDeletion>
      </Status>
    </AccessPolicies>
  </DescribeServiceAccessPoliciesResult>
  <ResponseMetadata>
    <RequestId>56240b10-731d-47a7-9887-REDACTED</RequestId>
  </ResponseMetadata>
</DescribeServiceAccessPoliciesResponse>

So my code:

package main

import (
	"context"
	"fmt"
	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/cloudsearch"
)

func main() {
	sess, err := session.NewSession(&aws.Config{
		Region:   aws.String("us-east-1"),
		LogLevel: aws.LogLevel(aws.LogDebugWithHTTPBody),
	})
	if err != nil {
		panic(err)
	}

	client := cloudsearch.New(sess)

	out, err := client.DescribeServiceAccessPoliciesWithContext(context.Background(), &cloudsearch.DescribeServiceAccessPoliciesInput{
		DomainName: aws.String("foo-domain"),
	})
	if err != nil {
		panic(err)
	}

	fmt.Println(*out.AccessPolicies.Options)

}

results in a correct policy being printed from Options:

{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"AWS":"*"},"Action":"cloudsearch:*"}]}

Thanks,
Ran~

from aws-sdk-go.

github-actions avatar github-actions commented on June 9, 2024

This issue has not received a response in 1 week. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled.

from aws-sdk-go.

github-actions avatar github-actions commented on June 9, 2024

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

from aws-sdk-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.