我在账户 A 中有 Step Function,在账户 B 中有 lambda。但是在运行 step 函数时,它给出:
An error occurred while executing the state 'lambdaB' (entered at the event id #2). The resource belongs to a different account from the running execution.
Run Code Online (Sandbox Code Playgroud)
有什么办法可以实现这种配置。
amazon-web-services amazon-iam aws-lambda aws-step-functions
我无法格式化以下字符串:
"Sony,20,30,40;LG,1,4,8"
Run Code Online (Sandbox Code Playgroud)
以下 JSON 格式:
"reported": {
"SETS": [
{
"prodName": "Sony",
"fmtd": "20",
"lmtd": "30",
"lm": "40"
},
{
"prodName": "LG",
"mtd": "1",
"lmtd": "4",
"lm": "8"
}
]
}
Run Code Online (Sandbox Code Playgroud)
我尝试了下面的代码,但没有得到正确的结果。
String stringFromProc = "SONY,20,30,40;LG,1,4,8";
String[] array1 = stringFromProc.split("[\\;]");
JSONObject jsonSubObject = null;
JSONObject jsonFinal = new JSONObject();
JSONArray jsonArrayRET = new JSONArray();
for(int i=0;i<array1.length;i++){
String []array2 = array1[i].split("[\\,]");
for(int j=0;j<array2.length;j++){
System.out.println(array2[j]);
jsonSubObject = new JSONObject();
jsonSubObject.put("prodName", array2[0]);
jsonSubObject.put("mtd", array2[1]);
jsonSubObject.put("lmtd", array2[2]);
jsonSubObject.put("lm", array2[3]);
jsonArrayRET.add(jsonSubObject);
jsonFinal.put("reported", jsonArrayRET);
}
} …Run Code Online (Sandbox Code Playgroud) 我正在尝试通过 CloudFormation 模板创建 IAM 角色和 KMS 密钥。我的要求是首先我需要创建 KMS 密钥,获取它的 ARN,然后在创建 IAM 角色时,必须传递该 KMS ARN。我的政策是这样的:
Resources:
myKey:
Type: AWS::KMS::Key
Properties:
Description: Key for encrypting S3 Buckets
Enabled: TRUE
KeyPolicy:
Version: '2012-10-17'
Statement:
- Sid: Enable IAM User Permissions
Effect: Allow
Principal:
AWS: arn:aws:iam::11111111:root
Action: kms:*
Resource: '*'
KeyUsage: ENCRYPT_DECRYPT
myAlias:
Type: AWS::KMS::Alias
Properties:
AliasName: alias/key_for_s3_encrytpion
TargetKeyId:
Ref: myKey
RootRole:
Type: 'AWS::IAM::Role'
Properties:
RoleName: 'Lambda-S3-SNS-VPC-Role-cft'
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal:
Service:
- lambda.amazonaws.com
Action:
- 'sts:AssumeRole'
Path: /
ManagedPolicyArns: …Run Code Online (Sandbox Code Playgroud) 有没有一种方法可以在本地 IBM MQ 与 AWS SQS/API Gateway 之间进行集成。我检查了很多链接,但发现我们可以将整个 IBM MQ 迁移到 AWS MQ,但无法从 AWS 调用到本地MQ。如果有人尝试过这种集成,请提出建议。