Policy Version
Provides a Resource Manager Policy Version resource. For information about Resource Manager Policy Version and how to use it, see What is Resource Manager Policy Version.
NOTE: Available since v1.84.0. NOTE: It is not recommended to use this resource management policy version, it is recommended to directly use the policy resource to manage your policy. Please refer to the link for usage resource_manager_policy.
Example Usage
Basic Usage
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.resourcemanager.Policy;
import com.pulumi.alicloud.resourcemanager.PolicyArgs;
import com.pulumi.alicloud.resourcemanager.PolicyVersion;
import com.pulumi.alicloud.resourcemanager.PolicyVersionArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var config = ctx.config();
final var name = config.get("name").orElse("tfexample");
var examplePolicy = new Policy("examplePolicy", PolicyArgs.builder()
.policyName(name)
.policyDocument("""
{
"Statement": [{
"Action": ["oss:*"],
"Effect": "Allow",
"Resource": ["acs:oss:*:*:*"]
}],
"Version": "1"
}
""")
.build());
var examplePolicyVersion = new PolicyVersion("examplePolicyVersion", PolicyVersionArgs.builder()
.policyName(examplePolicy.policyName())
.policyDocument("""
{
"Statement": [{
"Action": ["oss:*"],
"Effect": "Allow",
"Resource": ["acs:oss:*:*:myphotos"]
}],
"Version": "1"
}
""")
.build());
}
}
Content copied to clipboard
Import
Resource Manager Policy Version can be imported using the id, e.g.
$ pulumi import alicloud:resourcemanager/policyVersion:PolicyVersion example tftest:v2
Content copied to clipboard