Template name
ACS-OSS-PutBucketLogging
Template description
Enables the logging feature for an Object Storage Service (OSS) bucket.
Template type
Automated
Owner
Alibaba Cloud
Input parameters
Parameter | Description | Data type | Required | Default value | Limit |
bucketName | The name of the OSS bucket. | String | Yes | ||
regionId | The region ID. | String | No | {{ ACS::RegionId }} | |
logPrefix | The prefix of the log file. | String | No | No | |
OOSAssumeRole | The RAM role that is assumed by CloudOps Orchestration Service (OOS). | String | No | "" |
Output parameters
N/A.
Permission policy that is required to execute the template
{
"Version": "1",
"Statement": [
{
"Action": [
"oss:PutBucketLogging"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
References
Template content
FormatVersion: OOS-2019-06-01
Description:
en: Enable logging for a bucket
name-en: ACS-OSS-PutBucketLogging
categories:
- security
Parameters:
regionId:
Type: String
Label:
en: RegionId
AssociationProperty: RegionId
Default: '{{ ACS::RegionId }}'
bucketName:
Label:
en: BucketName
Type: String
logPrefix:
Label:
en: LogPrefix
Description:
en: The prefix of the saved log objects. This element can be left empty
Type: String
Default: 'No'
OOSAssumeRole:
Label:
en: OOSAssumeRole
Type: String
Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: putBucketLogging
Action: ACS::ExecuteAPI
Description:
en: Enable logging for a bucket
Properties:
Service: OSS
API: PutBucketLogging
Method: PUT
URI: '?logging'
Parameters:
RegionId: '{{ regionId }}'
BucketName: '{{ bucketName }}'
Body: <?xml version="1.0" encoding="UTF-8"?> <BucketLoggingStatus> <LoggingEnabled> <TargetBucket>{{ bucketName }}</TargetBucket> <TargetPrefix>{{ logPrefix }}</TargetPrefix> </LoggingEnabled> </BucketLoggingStatus>