public CreateGroupRequest withConfiguration(GroupConfigurationItem... configuration) {
        if (this.configuration == null) {
            setConfiguration(new java.util.ArrayList<GroupConfigurationItem>(configuration.length));
        }
        for (GroupConfigurationItem ele : configuration) {
            this.configuration.add(ele);
        }
        return this;
    }
<p>
A configuration associates the resource group with an Amazon Web Services service and specifies how the service
can interact with the resources in the group. A configuration is an array of <a>GroupConfigurationItem</a>
elements. For details about the syntax of service configurations, see <a
href="https://docs.aws.amazon.com/ARG/latest/APIReference/about-slg.html">Service configurations for Resource
Groups</a>.
</p>
<note>
<p>
A resource group can contain either a <code>Configuration</code> or a <code>ResourceQuery</code>, but not both.
</p>
</note>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setConfiguration(java.util.Collection)} or {@link #withConfiguration(java.util.Collection)} if you want
to override the existing values.
</p>

@param configuration
       A configuration associates the resource group with an Amazon Web Services service and specifies how the
       service can interact with the resources in the group. A configuration is an array of
       <a>GroupConfigurationItem</a> elements. For details about the syntax of service configurations, see <a
       href="https://docs.aws.amazon.com/ARG/latest/APIReference/about-slg.html">Service configurations for
       Resource Groups</a>.</p> <note>
       <p>
       A resource group can contain either a <code>Configuration</code> or a <code>ResourceQuery</code>, but not
       both.
       </p>
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-resourcegroups/src/main/java/com/amazonaws/services/resourcegroups/model/CreateGroupRequest.java