Aws Cloud Directory Policies on DynamicObjectFacet

0

Hi all. I'm working with Aws Cloud Directory using the managed schema and through the GO API, so far so good with objects, links, search, queries; but, when I try to create a policy object with dynamic faced I get the error: "Missing required node values: [policy_type, policy_document]"

I tried adding two more elements to the AttribuKeyAndValue but still got the error.

var keysAndValues []types.AttributeKeyAndValue

policyType := types.AttributeKeyAndValue{
	Key: &types.AttributeKey{
		SchemaArn: aws.String(APPLIED_SCHEMA_ARN),
		FacetName: aws.String("DynamicObjectFacet"),
		Name:      aws.String("policy_type"),
	},
	Value: &types.TypedAttributeValueMemberStringValue{
		Value: "AppUser",
	},
}

bina, _ := json.Marshal(obj)

policyDoc := types.AttributeKeyAndValue{
	Key: &types.AttributeKey{
		SchemaArn: aws.String(APPLIED_SCHEMA_ARN),
		FacetName: aws.String("DynamicObjectFacet"),
		Name:      aws.String("policy_document"),
	},
	Value: &types.TypedAttributeValueMemberBinaryValue{
		Value: bina,
	},
}

keysAndValues = append(keysAndValues, policyType)
keysAndValues = append(keysAndValues, policyDoc)

I would be grateful if someone gives me a light on how to create policy objects using the dynamic schema.

답변 없음

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠