Skip to content

Commit

Permalink
add examples of iam and obs (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason-Zhang9309 authored Oct 14, 2024
1 parent e6d12f1 commit b55fdde
Show file tree
Hide file tree
Showing 23 changed files with 610 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cluster/test/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ${KUBECTL} -n upbound-system wait --for=condition=Available deployment --all --t

echo "Creating a default provider config..."
cat <<EOF | ${KUBECTL} apply -f -
apiVersion: huaweicloud.upbound.io/v1beta1
apiVersion: huaweicloud.crossplane.io/v1beta1
kind: ProviderConfig
metadata:
name: default
Expand Down
11 changes: 11 additions & 0 deletions examples/iam/accesskey.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: iam.huaweicloud.crossplane.io/v1alpha1
kind: AccessKey
metadata:
annotations:
meta.upbound.io/example-id: iam/v1alpha1/accesskey
labels:
testing.upbound.io/example-name: key_1
name: key-1
spec:
forProvider:
userId: your_user_id
17 changes: 17 additions & 0 deletions examples/iam/acl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: iam.huaweicloud.crossplane.io/v1alpha1
kind: ACL
metadata:
annotations:
meta.upbound.io/example-id: iam/v1alpha1/acl
labels:
testing.upbound.io/example-name: acl
name: acl
spec:
forProvider:
ipCidrs:
- cidr: 159.138.39.192/32
description: This is a test ip address
ipRanges:
- description: This is a test ip range
range: 0.0.0.0-255.255.255.0
type: console
21 changes: 21 additions & 0 deletions examples/iam/agency.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: iam.huaweicloud.crossplane.io/v1alpha1
kind: Agency
metadata:
annotations:
meta.upbound.io/example-id: iam/v1alpha1/agency
labels:
testing.upbound.io/example-name: agency
name: agency
spec:
forProvider:
allResourcesRoles:
- Server Administrator
delegatedDomainName: your_domain_name
description: test agency
domainRoles:
- Anti-DDoS Administrator
name: test_agency
projectRole:
- project: cn-north-4
roles:
- Tenant Administrator
12 changes: 12 additions & 0 deletions examples/iam/group.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: iam.huaweicloud.crossplane.io/v1alpha1
kind: Group
metadata:
annotations:
meta.upbound.io/example-id: iam/v1alpha1/group
labels:
testing.upbound.io/example-name: group_1
name: group-1
spec:
forProvider:
description: This is a test group
name: group_1
13 changes: 13 additions & 0 deletions examples/iam/groupmembership.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: iam.huaweicloud.crossplane.io/v1alpha1
kind: GroupMembership
metadata:
annotations:
meta.upbound.io/example-id: iam/v1alpha1/groupmembership
labels:
testing.upbound.io/example-name: membership_1
name: membership-1
spec:
forProvider:
group: your_group_id
users:
- your_user_id
66 changes: 66 additions & 0 deletions examples/iam/grouproleassignment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
apiVersion: iam.huaweicloud.crossplane.io/v1alpha1
kind: GroupRoleAssignment
metadata:
annotations:
meta.upbound.io/example-id: iam/v1alpha1/grouproleassignment
labels:
testing.upbound.io/example-name: test
name: test
spec:
forProvider:
groupIdSelector:
matchLabels:
testing.upbound.io/example-name: group_1
projectId: your_project_id
roleIdSelector:
matchLabels:
testing.upbound.io/example-name: role1

apiVersion: iam.huaweicloud.crossplane.io/v1alpha1
kind: Group
metadata:
annotations:
meta.upbound.io/example-id: iam/v1alpha1/group
labels:
testing.upbound.io/example-name: group_1
name: group-1
spec:
forProvider:
description: This is a test group
name: group_1

apiVersion: iam.huaweicloud.crossplane.io/v1alpha1
kind: Role
metadata:
annotations:
meta.upbound.io/example-id: iam/v1alpha1/role
labels:
testing.upbound.io/example-name: role1
name: role1
spec:
forProvider:
description: created by crossplane
name: test
policy: |
{
"Version": "1.1",
"Statement": [
{
"Action": [
"obs:bucket:GetBucketAcl"
],
"Effect": "Allow",
"Resource": [
"obs:*:*:bucket:*"
],
"Condition": {
"StringStartWith": {
"g:ProjectName": [
"cn-north-4"
]
}
}
}
]
}
type: AX
17 changes: 17 additions & 0 deletions examples/iam/loginpolicy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: iam.huaweicloud.crossplane.io/v1alpha1
kind: LoginPolicy
metadata:
annotations:
meta.upbound.io/example-id: iam/v1alpha1/loginpolicy
labels:
testing.upbound.io/example-name: test
name: test
spec:
forProvider:
accountValidityPeriod: 20
customInfoForLogin: hello crossplane
lockoutDuration: 30
loginFailedTimes: 10
periodWithLoginFailures: 30
sessionTimeout: 120
showRecentLoginInfo: true
14 changes: 14 additions & 0 deletions examples/iam/passwordpolicy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: iam.huaweicloud.crossplane.io/v1alpha1
kind: PasswordPolicy
metadata:
annotations:
meta.upbound.io/example-id: iam/v1alpha1/passwordpolicy
labels:
testing.upbound.io/example-name: enhanced
name: enhanced
spec:
forProvider:
minimumPasswordLength: 12
numberOfRecentPasswordsDisallowed: 2
passwordCharCombination: 4
passwordValidityPeriod: 180
12 changes: 12 additions & 0 deletions examples/iam/project.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: iam.huaweicloud.crossplane.io/v1alpha1
kind: Project
metadata:
annotations:
meta.upbound.io/example-id: iam/v1alpha1/project
labels:
testing.upbound.io/example-name: project_1
name: project-1
spec:
forProvider:
description: This is a test project
name: cn-north-1_project1
16 changes: 16 additions & 0 deletions examples/iam/protectionpolicy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: iam.huaweicloud.crossplane.io/v1alpha1
kind: ProtectionPolicy
metadata:
annotations:
meta.upbound.io/example-id: iam/v1alpha1/protectionpolicy
labels:
testing.upbound.io/example-name: test
name: test
spec:
forProvider:
protectionEnabled: true
selfManagement:
- accessKey: true
email: false
mobile: false
password: true
35 changes: 35 additions & 0 deletions examples/iam/role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
apiVersion: iam.huaweicloud.crossplane.io/v1alpha1
kind: Role
metadata:
annotations:
meta.upbound.io/example-id: iam/v1alpha1/role
labels:
testing.upbound.io/example-name: role1
name: role1
spec:
forProvider:
description: created by terraform
name: test
policy: |
{
"Version": "1.1",
"Statement": [
{
"Action": [
"obs:bucket:GetBucketAcl"
],
"Effect": "Allow",
"Resource": [
"obs:*:*:bucket:*"
],
"Condition": {
"StringStartWith": {
"g:ProjectName": [
"cn-north-4"
]
}
}
}
]
}
type: AX
66 changes: 66 additions & 0 deletions examples/iam/roleassignment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
apiVersion: iam.huaweicloud.crossplane.io/v1alpha1
kind: RoleAssignment
metadata:
annotations:
meta.upbound.io/example-id: iam/v1alpha1/roleassignment
labels:
testing.upbound.io/example-name: role_assignment_1
name: role-assignment-1
spec:
forProvider:
groupIdSelector:
matchLabels:
testing.upbound.io/example-name: group_1
projectId: your_project_id
roleIdSelector:
matchLabels:
testing.upbound.io/example-name: role1

apiVersion: iam.huaweicloud.crossplane.io/v1alpha1
kind: Group
metadata:
annotations:
meta.upbound.io/example-id: iam/v1alpha1/group
labels:
testing.upbound.io/example-name: group_1
name: group-1
spec:
forProvider:
description: This is a test group
name: group_1

apiVersion: iam.huaweicloud.crossplane.io/v1alpha1
kind: Role
metadata:
annotations:
meta.upbound.io/example-id: iam/v1alpha1/role
labels:
testing.upbound.io/example-name: role1
name: role1
spec:
forProvider:
description: created by crossplane
name: test
policy: |
{
"Version": "1.1",
"Statement": [
{
"Action": [
"obs:bucket:GetBucketAcl"
],
"Effect": "Allow",
"Resource": [
"obs:*:*:bucket:*"
],
"Condition": {
"StringStartWith": {
"g:ProjectName": [
"cn-north-4"
]
}
}
}
]
}
type: AX
16 changes: 16 additions & 0 deletions examples/iam/user.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: iam.huaweicloud.crossplane.io/v1alpha1
kind: User
metadata:
annotations:
meta.upbound.io/example-id: iam/v1alpha1/user
labels:
testing.upbound.io/example-name: test
name: test
spec:
forProvider:
description: A user
name: user_1
passwordSecretRef:
key: password
name: user-secret
namespace: crossplane-system
Loading

0 comments on commit b55fdde

Please sign in to comment.