Amazon Managed Service for Apache Flink (Amazon MSF) was previously known as Amazon Kinesis Data Analytics for Apache Flink.
How Amazon Managed Service for Apache Flink works with IAM
In Amazon MSF, you use IAM in the following different contexts:
-
Application permissions: Control access by the application to external resources, such as Amazon S3, Amazon Kinesis Data Streams, or Amazon DynamoDB, that use IAM authentication.
-
Application management and lifecycle control permissions: Control use of Amazon MSF API actions, such as CreateApplication, StartApplication, and UpdateApplication, which control the application lifecycle. For a complete list of all Amazon MSF API actions that you can specify in the
Action
element of an IAM policy statement, see Actions defined by Amazon Kinesis Analytics V2 in the Service Authorization Reference.
Topics
Application permissions
You control IAM permissions of an Amazon MSF application with the IAM role assigned to the application, as part of the application configuration. This IAM role determines application’s permissions to access other services, such as Amazon S3, Kinesis Data Streams, or DynamoDB, which use IAM for authorization.
Warning
Changing the permissions for a service role might break Amazon MSF functionality. Make sure you don't remove permissions for the application to download the application code from the Amazon S3 bucket, and send logs to Amazon CloudWatch.
Assigning permissions to the application using resource-based policies isn't supported. You can't specify an Amazon MSF application as principal in a policy attached to the resource to be accessed.
Topics
Permissions to access the application code and application logs
Amazon MSF also uses the application IAM role to access the application code uploaded in an Amazon S3 bucket, and to write the application logs to Amazon CloudWatch Logs.
When you create or update the application using the Amazon Web Services Management Console, choose Create / update IAM role <role-name> with required policies in the Application configuration, Amazon MSF automatically creates and modifies the IAM role assigning the required permissions to Amazon S3 and CloudWatch Logs.
If you create the IAM role manually or if you create and manage the application using automation tools, you must add the following permissions to the application IAM role.
{ "Version": "2012-10-17", "Statement": [ { "Sid": "ReadCode", "Effect": "Allow", "Action": [ "s3:GetObject", "s3:GetObjectVersion" ], "Resource": [ "arn:aws-cn:s3:::
bucket-name
/path-to-application-code
" ] }, { "Sid": "ListCloudwatchLogGroups", "Effect": "Allow", "Action": [ "logs:DescribeLogGroups" ], "Resource": [ "arn:aws-cn:logs:region
:account-id
:log-group:*" ] }, { "Sid": "ListCloudwatchLogStreams", "Effect": "Allow", "Action": [ "logs:DescribeLogStreams" ], "Resource": [ "arn:aws-cn:logs:region
:account-id
:log-group:/aws/kinesis-analytics/application-name
:log-stream:*" ] }, { "Sid": "PutCloudwatchLogs", "Effect": "Allow", "Action": [ "logs:PutLogEvents" ], "Resource": [ "arn:aws-cn:logs:region
:account-id
:log-group:/aws/kinesis-analytics/application-name
:log-stream:kinesis-analytics-log-stream" ] } ] }
Cross-service confused deputy prevention
When an Amazon MSF application calls a different Amazon Web Services service, you can provide more granular access permissions. For example, if an IAM role is reused across multiple applications, an application may get access to a resource it should not be have access to. This is known as the confused deputy problem. For information about how the accessed resource can restrict access to a specific Amazon MSF application, see Cross-service confused deputy prevention.
Application management and lifecycle control permissions
Actions to manage the application and its lifecycle, such as CreateApplication, StartApplication, and UpdateApplication, are controlled through identity-based policies associated to the resource performing the action, such as an IAM user, IAM group, or a resource such as Amazon Lambda calling the Amazon MSF API.
Note
The API and SDK controlling Amazon MSF application lifecycle is called Amazon Kinesis Analytics V2, for backward compatibility reasons.
Assigning permissions for application lifecycle actions using resource-based policies attached to the Amazon MSF application isn't supported. The application IAM role isn't used to control access to the application lifecycle actions. You should not add application lifecycle permissions to the application role.
The following table lists the IAM features you can use with Amazon MSF application lifecycle actions.
IAM feature | Managed Service for Apache Flink support |
---|---|
Yes |
|
No |
|
Yes |
|
Yes |
|
Yes |
|
No |
|
Yes |
|
Yes |
|
Yes |
|
No |
|
No |
-
For a high-level view of how Managed Service for Apache Flink and other Amazon Web Services services work with most IAM features, see Amazon Web Services services that work with IAM in the IAM User Guide.
-
For information about the service-specific resources, actions, and condition context keys that you can use in IAM permission policies, see Actions, resources, and condition keys for Amazon Kinesis Analytics V2 in the Service Authorization Reference.
Topics
Application lifecycle policy actions
Supports policy actions: Yes
Administrators can use Amazon JSON policies to specify who has access to what. That is, which principal can perform actions on what resources, and under what conditions.
The Action
element of a JSON policy describes the
actions that you can use to allow or deny access in a policy. Policy
actions usually have the same name as the associated Amazon API operation. There are some exceptions, such as permission-only
actions that don't have a matching API operation. There are also some operations that require multiple actions in a policy.
These additional actions are called dependent actions.
Include actions in a policy to grant permissions to perform the associated operation.
Policy actions in Amazon MSF use the kinesisanalytics
prefix before the action. Amazon MSF APIs and SDKs use the Amazon Kinesis Analytics V2
prefix.
To specify multiple actions in a single statement, separate them with commas. The following example shows the syntax for specifying Amazon MSF policy actions.
"Action" : [ "kinesisanalytics:
action1
", "kinesisanalytics:action2
" ]
You can also specify multiple actions using wildcards (*). For example, to specify all actions that begin with the word Describe
, include the following action.
"Action": "kinesisanalytics:Describe*"
To see a complete list of all Amazon MSF API actions that you can specify in the Action
element of an IAM policy statement, see Actions defined by Amazon Kinesis Analytics V2.
To view examples of Amazon MSF identity-based policies, see Identity-based policy examples.
Application lifecycle policy resources
Supports policy resources: Yes
Administrators can use Amazon JSON policies to specify who has access to what. That is, which principal can perform actions on what resources, and under what conditions.
The Resource
JSON policy element specifies the object or objects to which the action applies. Statements must include either a
Resource
or a NotResource
element. As a best practice, specify a resource using its Amazon Resource Name (ARN). You can do this for actions that support a
specific resource type, known as resource-level permissions.
For actions that don't support resource-level permissions, such as listing operations, use a wildcard (*) to indicate that the statement applies to all resources.
"Resource": "*"
Permissions for Amazon MSF application lifecycle actions are defined for each application. The Resource
JSON element in an IAM policy defines the Amazon MSF application to which the permissions apply.
You can assign permission to a single application by specifying the application ARN, or a group of application by using wildcards. The following example shows the syntax of the Resource
element.
"Resouce" : "arn:
partition
:kinesisanalytics:Region
:account
:application/application-name
You can also assign permissions to control a subset of applications using wildcards. For example, you can assign permissions to control all applications whose name starts with a specific prefix.
"Resouce" : "arn:
partition
:kinesisanalytics:Region
:account
:application/application-name-prefix*
Application lifecycle policy condition keys
Supports service-specific policy condition keys: Yes
Administrators can use Amazon JSON policies to specify who has access to what. That is, which principal can perform actions on what resources, and under what conditions.
The Condition
element (or Condition
block) lets you specify conditions in which a
statement is in effect. The Condition
element is optional. You can create
conditional expressions that use condition
operators, such as equals or less than, to match the condition in the
policy with values in the request.
If you specify multiple Condition
elements in a statement, or
multiple keys in a single Condition
element, Amazon evaluates them using
a logical AND
operation. If you specify multiple values for a single
condition key, Amazon evaluates the condition using a logical OR
operation. All of the conditions must be met before the statement's permissions are
granted.
You can also use placeholder variables when you specify conditions. For example, you can grant an IAM user permission to access a resource only if it is tagged with their IAM user name. For more information, see IAM policy elements: variables and tags in the IAM User Guide.
Amazon supports global condition keys and service-specific condition keys. To see all Amazon global condition keys, see Amazon global condition context keys in the IAM User Guide.
You can use condition keys to control permissions to Amazon MSF application lifecycle actions. To see a list of Managed Service for Apache Flink condition keys, see Condition Keys for Amazon Managed Service for Apache Flink in the Service Authorization Reference. To learn with which actions and resources you can use a condition key, see Actions Defined by Amazon Managed Service for Apache Flink.
Attribute-based access control (ABAC) with Managed Service for Apache Flink
Supports ABAC (tags in policies): Yes
Using condition keys, you can implement attribute-based access control (ABAC), which is an authorization strategy that defines permissions based on attributes. In Amazon, these attributes are called tags. You can attach tags to IAM entities (users or roles) and to many Amazon resources. Tagging entities and resources is the first step of ABAC. Then, you design ABAC policies to allow operations when the principal's tag matches the tag on the resource that they are trying to access.
ABAC is helpful in environments that are growing rapidly and helps with situations where policy management becomes cumbersome.
To control access based on tags, you provide tag information in the condition element of a policy using the aws:ResourceTag/key-name
, aws:RequestTag/key-name
, or aws:TagKeys
condition keys. If a service supports all three condition keys for every resource type, then the value is Yes for the service. If a service supports all three condition keys for only some resource types, then the value is Partial.
-
For more information about ABAC, see Define permissions based on attributes with ABAC authorization.
-
To view a tutorial with the steps for setting up ABAC, see IAM tutorial: Define permissions to access Amazon resources based on tags.
Using temporary credentials
Supports temporary credentials: Yes
Amazon MSF application lifecycle actions support temporary credentials.
You're using temporary credentials if you sign in to the Amazon Web Services Management Console using any method except a user name and password. For example, when you access Amazon using your company's single sign-on (SSO) link, that process automatically creates temporary credentials. You also automatically create temporary credentials when you sign in to the console as a user and then switch roles. For more information about switching roles, see Switch from a user to an IAM role (console).
You can manually create temporary credentials using the Amazon CLI or Amazon API. You can then use those temporary credentials to access Amazon. We recommend that you dynamically generate temporary credentials instead of using long-term access keys. For more information, see Temporary security credentials in IAM.
Cross-service principal permissions
Supports forward access sessions (FAS): Yes
Amazon MSF application lifecycle actions support cross-service principal permissions.
When you use an IAM user or role to perform actions in Amazon, you're considered a principal. When you use some services, you might perform an action that then initiates another action in a different service. Forward access sessions (FAS) uses the permissions of the principal calling an Amazon Web Services service, combined with the requesting Amazon Web Services service to make requests to downstream services. FAS requests are only made when a service receives a request that requires interactions with other Amazon Web Services services or resources to complete. In this case, you must have permissions to perform both actions. For policy details when making FAS requests, see Forward access sessions.
Identity-based policies for Managed Service for Apache Flink
Supports identity-based policies: Yes
Identity-based policies are JSON permissions policy documents that you can attach to an identity, such as an IAM user, group of users, or role. These policies control what actions users and roles can perform, on which resources, and under what conditions. To learn how to create an identity-based policy, see Define custom IAM permissions with customer managed policies in the IAM User Guide.
With IAM identity-based policies, you can specify allowed or denied actions and resources as well as the conditions under which actions are allowed or denied. You can't specify the principal in an identity-based policy because it applies to the user or role to which it is attached. To learn about all of the elements that you can use in a JSON policy, see IAM JSON policy elements reference in the IAM User Guide.
Identity-based policy examples for Managed Service for Apache Flink
To view examples of Managed Service for Apache Flink identity-based policies, see Identity-based policy examples for Amazon Managed Service for Apache Flink.
Resource-based policies within Managed Service for Apache Flink
Amazon Managed Service for Apache Flink currently does not support resource-based access control.
Access control lists (ACLs) in Managed Service for Apache Flink
Supports ACLs: No
Access control lists (ACLs) control which principals (account members, users, or roles) have permissions to access a resource. ACLs are similar to resource-based policies, although they do not use the JSON policy document format.
Service roles for Managed Service for Apache Flink
Supports service roles: Yes
A service role is an IAM role that a service assumes to perform actions on your behalf. An IAM administrator can create, modify, and delete a service role from within IAM. For more information, see Create a role to delegate permissions to an Amazon Web Services service in the IAM User Guide.
Warning
Changing the permissions for a service role might break Managed Service for Apache Flink functionality. Edit service roles only when Managed Service for Apache Flink provides guidance to do so.
Service-linked roles for Managed Service for Apache Flink
Supports service-linked roles: Yes
A service-linked role is a type of service role that is linked to an Amazon Web Services service. The service can assume the role to perform an action on your behalf. Service-linked roles appear in your Amazon Web Services account and are owned by the service. An IAM administrator can view, but not edit the permissions for service-linked roles.
For details about creating or managing service-linked roles, see Amazon services that work with IAM. Find
a service in the table that includes a Yes
in the Service-linked role column.
Choose the Yes link to view the service-linked role documentation for that service.