diff --git a/docs/reference/iam-auth-policy.md b/docs/reference/iam-auth-policy.md new file mode 100644 index 00000000..b819008c --- /dev/null +++ b/docs/reference/iam-auth-policy.md @@ -0,0 +1,177 @@ +# IAMAuthPolicy API Reference + +## Introduction + +VPC Lattice auth policies are IAM policy documents that you attach to service networks or services to control whether a specified principal has access to a group of services or specific service (AuthZ). +IAMAuthPolicy implements Direct Policy Attachment of Gateway API's [GEP-713: Metaresources and Policy Attachment](https://gateway-api.sigs.k8s.io/geps/gep-713). +Policy can be attached to [Gateway, HTTPRoute, GRPCRoute Kinds](#application-networking.k8s.aws/v1alpha1.IAMAuthPolicySpec). Gateway policy attaches to Lattice Service Network and HTTP/GRPCRoute to Lattice Service. +Please see [Control access to services using auth policies](https://docs.aws.amazon.com/vpc-lattice/latest/ug/auth-policies.html) for more details about Lattice Auth Policies. + +Notice that the IAMAuthPolicy can only do authorization for traffic that go through gateway or HTTPRoute/GRPCRoute. The authorization will not take effect if the client directly send traffic to the k8s service DNS. + +[This article](https://aws.amazon.com/blogs/containers/implement-aws-iam-authentication-with-amazon-vpc-lattice-and-amazon-eks/) is also a good reference on how to set up VPC Lattice auth policy in the kubernetes. + +## API Specification + +
Field | +Description | +||||
---|---|---|---|---|---|
+ metadata + + + Kubernetes meta/v1.ObjectMeta + + + |
+
+ Refer to the Kubernetes API documentation for the fields of the
+ metadata field.
+ |
+ ||||
+ spec + + + IAMAuthPolicySpec + + + |
+
+ + +
|
+ ||||
+ status + + + IAMAuthPolicyStatus + + + |
+
+ Status defines the current state of IAMAuthPolicy. + |
+
+ (Appears on:IAMAuthPolicy) +
+IAMAuthPolicySpec defines the desired state of IAMAuthPolicy. + When the controller handles IAMAuthPolicy creation, if the targetRef k8s and VPC Lattice resource exists, the controller will change the auth_type of that VPC Lattice resource to AWS_IAM and attach this policy. + When the controller handles IAMAuthPolicy deletion, if the targetRef k8s and VPC Lattice resource exists, the controller will change the auth_type of that VPC Lattice resource to NONE and detach this policy. +
+Field | +Description | +
---|---|
+ policy + + string + + |
+
+ IAM auth policy content. It is a JSON string that uses the same syntax as AWS IAM policies. Please check the VPC Lattice documentation to get the common elements in an auth policy + |
+
+ targetRef + + sigs.k8s.io/gateway-api/apis/v1alpha2.PolicyTargetReference + + |
+
+ TargetRef points to the Kubernetes Gateway, HTTPRoute, or GRPCRoute resource that will have this policy attached. +This field is following the guidelines of Kubernetes Gateway API policy attachment. + |
+
+ (Appears on:IAMAuthPolicy) +
+IAMAuthPolicyStatus defines the observed state of IAMAuthPolicy.
+Field | +Description | +
---|---|
+ conditions + + + []Kubernetes meta/v1.Condition + + + |
+
+ (Optional)
+ Conditions describe the current conditions of the IAMAuthPolicy. +Implementations should prefer to express Policy conditions
+ using the Known condition types are: +
|
+